summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | core: schedule time and timezone change events a bit before .timer ↵Lennart Poettering2018-06-061-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | elapsation events We really should make sure that .timer units are dispatched while taking the newest time/timezone data into account.
| * | | time-util: introduce common implementation of TFD_TIMER_CANCEL_ON_SET client ↵Lennart Poettering2018-06-065-44/+40
| | | | | | | | | | | | | | | | | | | | | | | | code We now use pretty much the same code at three places, let's unify that.
| * | | core: subscribe to /etc/localtime timezone changes and update timer ↵Lennart Poettering2018-06-064-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | elapsation accordingly Fixes: #8233 This is our first real-life usecase for the new sd_event_add_inotify() calls we just added.
| * | | core: move destruction of old time event sources to manager_setup_time_change()Lennart Poettering2018-06-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | It's a bit prettier that day as the function won't silently overwrite any possibly pre-initialized field, and destroy it right before we allocate a new event source.
| * | | man: document the new sd_event_add_inotify() callLennart Poettering2018-06-069-0/+198
| | | |
| * | | sd-event: add test for the new sd_event_add_inotify() APILennart Poettering2018-06-061-1/+147
| | | | | | | | | | | | | | | | | | | | | | | | This tests a couple of corner cases of the sd-event API including changing priorities of existing event sources, as well as overflow conditions of the inotify queue.
| * | | sd-event: add new API for subscribing to inotify eventsLennart Poettering2018-06-063-1/+821
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new call sd_event_add_inotify() which allows watching for inotify events on specified paths. sd-event will try to minimize the number of inotify fds allocated, and will try to add file watches to the same inotify fd objects as far as that's possible. Doing this kind of inotify object should optimize behaviour in programs that watch a limited set of mostly independent files as in most cases a single inotify object will suffice for watching all files. Traditionally, this kind of coalescing logic (i.e. that multiple event sources are implemented on top of a single inotify object) was very hard to do, as the inotify API had serious limitations: it only allowed adding watches by path, and would implicitly merge watches installed on the same node via different path, without letting the caller know about whether such merging took place or not. With the advent of O_PATH this issue can be dealt with to some point: instead of adding a path to watch to an inotify object with inotify_add_watch() right away, we can open the path with O_PATH first, call fstat() on the fd, and check the .st_dev/.st_ino fields of that against a list of watches we already have in place. If we find one we know that the inotify_add_watch() will update the watch mask of the existing watch, otherwise it will create a new watch. To make this race-free we use inotify_add_watch() on the /proc/self/fd/ path of the O_PATH fd, instead of the original path, so that we do the checking and watch updating with guaranteed the same inode. This approach let's us deal safely with inodes that may appear under various different paths (due to symlinks, hardlinks, bind mounts, fs namespaces). However it's not a perfect solution: currently the kernel has no API for changing the watch mask of an existing watch -- unless you have a path or fd to the original inode. This means we can "merge" the watches of the same inode of multiple event sources correctly, but we cannot "unmerge" it again correctly in many cases, as access to the original inode might have been lost, due to renames, mount/unmount, or deletions. We could in theory always keep open an O_PATH fd of the inode to watch so that we can change the mask anytime we want, but this is highly problematics, as it would consume too many fds (and in fact the scarcity of fds is the reason why watch descriptors are a separate concepts from fds) and would keep the backing mounts busy (wds do not keep mounts busy, fds do). The current implemented approach to all this: filter in userspace and accept that the watch mask on some inode might be higher than necessary due to earlier installed event sources that might have ceased to exist. This approach while ugly shouldn't be too bad for most cases as the same inodes are probably wacthed for the same masks in most implementations. In order to implement priorities correctly a seperate inotify object is allocated for each priority that is used. This way we get separate per-priority event queues, of which we never dequeue more than a few events at a time. Fixes: #3982
| * | | sd-event: voidify more thingsLennart Poettering2018-06-061-1/+1
| | | |
| * | | sd-event: propagate errors from source_set_pending() in all casesLennart Poettering2018-06-061-5/+14
| | | |
| * | | sd-event: drop pending events when we turn off/on an event sourceLennart Poettering2018-06-061-0/+15
| | | |
| * | | sd-event: use symbolic name for normal priorityLennart Poettering2018-06-061-1/+1
| | | |
| * | | sd-event: use structure initialization for epoll_eventLennart Poettering2018-06-061-15/+20
| | |/ | |/|
* | | NEWS: add note about --runtimeZbigniew Jędrzejewski-Szmek2018-06-061-0/+4
| | |
* | | locale: add _unused_ attribute for dummy variableYu Watanabe2018-06-061-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This suppresses the following warning by clang: ``` [588/1179] Compiling C object 'systemd-localed@exe/src_locale_localed.c.o'. ../src/locale/localed.c:271:39: warning: unused variable 'dummy' [-Wunused-variable] _cleanup_(locale_free) char **dummy = new_locale; ^ ```
* | | hwdb: add accel mount settings for Cube i7 Stylus I8L Model (#9207)rubensa2018-06-061-0/+4
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are different Cube i7 Stylus generations. Those are identified with the printed serial code sticker on motherboard (Printed serial code on casing is not always true) Order of Model (Old - New): W WA WWA WN(I8WN) I8L(With W on casing) I own a I8L generation so the hw identification for my model does not work. # cat /sys/class/dmi/id/sys_vendor Cube # сat /sys/class/dmi/id/product_name i8-L
* | update TODOLennart Poettering2018-06-061-0/+6
|/
* man: fix typoMichael Prokop2018-06-061-1/+1
|
* Fix DPI for Logitech M185, M510, and M705. (#9182)Peter Jones2018-06-061-1/+1
| | | | | | | | | | | | | | | | The DPI for three logitech models, the M185, M510, and M705, appear to have always been different here than what logitech's given specs say. With my M510, this results in jumpy behavior when transitioning from fast motion to slow motion, making clicking specific buttons or highlighting specific text *very* frustrating. This patch changes those 3 mice to the published resolution, which resolves the problem with my M510. I have chosen to fix those 3 simply because they were already grouped together, and all incorrect as compared to logitech's web site, and as such I have not tried other mice or investigated if there are other non-matching values in the database as well. Signed-off-by: Peter Jones <pjones@redhat.com>
* util: tighten on_tty() check a bit, also check stderrLennart Poettering2018-06-061-1/+10
| | | | | | | Let's detect output redirection a bit better, cover both stdout and stderr. Fixes: #9192
* Merge pull request #9148 from poettering/tidy-lateLennart Poettering2018-06-065-35/+119
|\ | | | | make PID watching a bit less expensive
| * core: watch PIDs of scope units right after starting themLennart Poettering2018-06-051-0/+3
| | | | | | | | | | | | Scope units don't have a main or control process we can watch, hence let's explicitly watch the PIDs contained in them early on, just to make things more robust and have at least something to watch.
| * core: rework how we track service and scope PIDsLennart Poettering2018-06-054-34/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reworks how systemd tracks processes on cgroupv1 systems where cgroup notification is not reliable. Previously, whenever we had reason to believe that new processes showed up or got removed we'd scan the cgroup of the scope or service unit for new processes, and would tidy up the list of PIDs previously watched. This scanning is relatively slow, and does not scale well. With this change behaviour is changed: instead of scanning for new/removed processes right away we do this work in a per-unit deferred event loop job. This event source is scheduled at a very low priority, so that it is executed when we have time but does not starve other event sources. This has two benefits: this expensive work is coalesced, if events happen in quick succession, and we won't delay SIGCHLD handling for too long. This patch basically replaces all direct invocation of unit_watch_all_pids() in scope.c and service.c with invocations of the new unit_enqueue_rewatch_pids() call which just enqueues a request of watching/tidying up the PID sets (with one exception: in scope_enter_signal() and service_enter_signal() we'll still do unit_watch_all_pids() synchronously first, since we really want to know all processes we are about to kill so that we can track them properly. Moreover, all direct invocations of unit_tidy_watch_pids() and unit_synthesize_cgroup_empty_event() are removed too, when the unit_enqueue_rewatch_pids() call is invoked, as the queued job will run those operations too. All of this is done on cgroupsv1 systems only, and is disabled on cgroupsv2 systems as cgroup-empty notifications are reliable there, and we do not need SIGCHLD events to track processes there. Fixes: #9138
| * cgroup: tiny log message tweak, say that we ignore one kind of failureLennart Poettering2018-06-051-1/+1
|/
* Merge pull request #9158 from poettering/notify-auto-reloadZbigniew Jędrzejewski-Szmek2018-06-0514-19/+39
|\ | | | | trigger OnFailure= only if Restart= is not in effect
| * update NEWS to explain new OnFailure= behaviourLennart Poettering2018-06-011-0/+8
| |
| * core: don't trigger OnFailure= deps when a unit is going to restartLennart Poettering2018-06-0113-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | This adds a flags parameter to unit_notify() which can be used to pass additional notification information to the function. We the make the old reload_failure boolean parameter one of these flags, and then add a new flag that let's unit_notify() if we are configured to restart the service. Note that this adjusts behaviour of systemd to match what the docs say. Fixes: #8398
| * core: when we can't enqueue OnFailure= job show full error messageLennart Poettering2018-06-011-3/+4
| | | | | | | | | | Let's ask for the full error message and show it, there's really no reason to just show the crappy errno error.
* | man: use entities for fedora number and update URLZbigniew Jędrzejewski-Szmek2018-06-051-7/+10
| | | | | | | | | | | | | | | | Fedora 28 is out already, let's advertise it. While at it, drop "container" from "f28container" — it's a subdirectory under /var/lib/machines, it's pretty obvious that's it a container. To make the switch easier in the future, define the number as an entity.
* | travis: use Fedora 27 as a base imageEvegeny Vereshchagin2018-06-051-2/+1
| | | | | | | | | | | | It was confirmed experimentally that Fedora 27 is more suitable for running cov-build than Fedora 28: https://github.com/systemd/systemd/issues/9186#issuecomment-394577877.
* | travis: get python installed while building a docker imageEvegeny Vereshchagin2018-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | coverity.sh tries to run python, so it should be installed to make everything work. According to https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3#Current_status, python seems to be the right name of the package. Closes https://github.com/systemd/systemd/issues/9186.
* | Merge pull request #9184 from msekletar/travis-followupsEvgeny Vereshchagin2018-06-042-3/+1
|\ \ | | | | | | Travis CI follow ups
| * | travis: drop ccache requirementMichal Sekletar2018-06-041-1/+0
| | |
| * | travis: DOCKER_REPOSITORY is no longer set. Don't require it.Michal Sekletar2018-06-041-2/+1
|/ /
* | travis: use Travis CI only for running scheduled Coverity scansMichal Sekletar2018-06-043-133/+9
| | | | | | | | | | Building and testing of systemd on Fedora Rawhide is now handled by dedicated Fedora CI. We don't need to duplicate this in Travis CI.
* | conf-parser: fix memleak (#9177)Yu Watanabe2018-06-041-1/+2
| | | | | | | | | | Fixes CID#1391437. Closes #9180.
* | Update 60-sensor.hwdbMarcel Hoppe2018-06-041-0/+1
| | | | | | | | | | | | add chuwi hibook with newer bios version [zj: remove duplicate matrix]
* | basic/log: add the log_struct terminator to macroZbigniew Jędrzejewski-Szmek2018-06-0420-114/+60
| | | | | | | | | | This way all callers do not need to specify it. Exhaustively tested by running test-log under valgrind ;)
* | Merge pull request #9176 from keszybz/flags-setLennart Poettering2018-06-0414-19/+45
|\ \ | | | | | | Macro to check if flags are set
| * | basic/path-util: use FLAGS_SET in one more placeZbigniew Jędrzejewski-Szmek2018-06-041-4/+2
| | |
| * | Add macro for checking if some flags are setZbigniew Jędrzejewski-Szmek2018-06-0412-13/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | This way we don't need to repeat the argument twice. I didn't replace all instances. I think it's better to leave out: - asserts - comparisons like x & y == x, which are mathematically equivalent, but here we aren't checking if flags are set, but if the argument fits in the flags.
| * | coccinelle: add option to make changes in placeZbigniew Jędrzejewski-Szmek2018-06-041-2/+10
| | |
| * | coccinelle: run spatch just on version-controlled filesZbigniew Jędrzejewski-Szmek2018-06-041-2/+5
| | | | | | | | | | | | | | | | | | | | | Also, allow run-cocinnelle.sh to be started from any directory. Unfortunately set -x does not work nicely anymore, because the list is too verbose. Replace it by an echo line.
* | | Merge pull request #9167 from keszybz/ellipsizationLennart Poettering2018-06-045-40/+133
|\ \ \ | | | | | | | | Ellipsization fixes based on unit-testing and fuzzing
| * | | test-ellipsize: add tests for ellipsize_mem, fix bugsZbigniew Jędrzejewski-Szmek2018-06-024-32/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, ellipsize() and ellipsize_mem() should not read past the input buffer. Those functions take an explicit length for the input data, so they should not assume that the buffer is terminated by a nul. Second, ellipsization was off in various cases where wide on multi-byte characters were used. We had some basic test for ellipsize(), but apparently it wasn't enough to catch more serious cases. Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8686.
| * | | basic/string-util: make ellipsize() inlineZbigniew Jędrzejewski-Szmek2018-06-022-8/+4
| | | | | | | | | | | | | | | | | | | | Once the redundant check is removed, it's a very simple wrapper around ellipsize_mem().
* | | | Merge pull request #9147 from keszybz/runtime-enablementLennart Poettering2018-06-045-133/+98
|\ \ \ \ | | | | | | | | | | Runtime enablement
| * | | | systemctl: when removing enablement or mask symlinks, cover both /run and /etcZbigniew Jędrzejewski-Szmek2018-06-013-98/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'systemctl disable --runtime' would disable a unit, but only if it was enabled with '--runtime', and silently do nothing if the unit was enabled persistently. And similarly 'systemctl disable' would do nothing if the unit was enabled in /run. This just doesn't seem useful. This pathch changes enable/disable and mask/unmask to be asymmetrical. enable and mask create symlinks in /etc or /run, depending on whether --runtime was specified. disable and unmask remove symlinks from both locations. --runtime cannot be specified for the disable and unmask verbs. The advantage is that 'disable' now means that the unit is disabled, period. And similarly for 'unmask', all masks are removed. Similarly for preset and preset-all, they now cannot be called with --runtime, and are asymmetrical: when they enable a unit, symlinks are created in /etc. When they disable a unit, all symlinks are nuked. $ systemctl --root=/ enable bluetooth Created symlink /etc/systemd/system/dbus-org.bluez.service → /usr/lib/systemd/system/bluetooth.service. Created symlink /etc/systemd/system/bluetooth.target.wants/bluetooth.service → /usr/lib/systemd/system/bluetooth.service. $ systemctl --root=/ --runtime enable bluetooth Created symlink /run/systemd/system/dbus-org.bluez.service → /usr/lib/systemd/system/bluetooth.service. Created symlink /run/systemd/system/bluetooth.target.wants/bluetooth.service → /usr/lib/systemd/system/bluetooth.service. $ systemctl --root=/ disable bluetooth Removed /run/systemd/system/bluetooth.target.wants/bluetooth.service. Removed /run/systemd/system/dbus-org.bluez.service. Removed /etc/systemd/system/bluetooth.target.wants/bluetooth.service. Removed /etc/systemd/system/dbus-org.bluez.service. $ systemctl --root=/ disable --runtime bluetooth --runtime cannot be used with disable $ systemctl --root=/ mask --runtime bluetooth Created symlink /run/systemd/system/bluetooth.service → /dev/null. $ systemctl --root=/ mask bluetooth Created symlink /etc/systemd/system/bluetooth.service → /dev/null. $ systemctl --root=/ unmask bluetooth Removed /run/systemd/system/bluetooth.service. Removed /etc/systemd/system/bluetooth.service. $ systemctl --root=/ unmask --runtime bluetooth --runtime cannot be used with unmask $ systemctl --root=/ --runtime enable bluetooth Created symlink /run/systemd/system/dbus-org.bluez.service → /usr/lib/systemd/system/bluetooth.service. Created symlink /run/systemd/system/bluetooth.target.wants/bluetooth.service → /usr/lib/systemd/system/bluetooth.service. $ systemctl --root=/ enable bluetooth Created symlink /etc/systemd/system/dbus-org.bluez.service → /usr/lib/systemd/system/bluetooth.service. Created symlink /etc/systemd/system/bluetooth.target.wants/bluetooth.service → /usr/lib/systemd/system/bluetooth.service. $ systemctl --root=/ preset bluetooth Removed /run/systemd/system/bluetooth.target.wants/bluetooth.service. Removed /run/systemd/system/dbus-org.bluez.service. Removed /etc/systemd/system/bluetooth.target.wants/bluetooth.service. Removed /etc/systemd/system/dbus-org.bluez.service. $ systemctl --root=/ preset --runtime bluetooth --runtime cannot be used with preset $ systemctl preset-all --runtime --runtime cannot be used with preset-all
| * | | | systemctl: remove newlinesZbigniew Jędrzejewski-Szmek2018-05-311-15/+0
| | | | | | | | | | | | | | | | | | | | This file is long enough already, we don't need extra vertical whitespace.
| * | | | Fix reporting of enabled-runtime unitsZbigniew Jędrzejewski-Szmek2018-05-311-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would always report them as "enabled", because path_is_config() includes /run, despite the name. Fixes #9122.
| * | | | core/dbus: simplify bus_done_{api,system} functionsZbigniew Jędrzejewski-Szmek2018-05-311-8/+2
| | | | | | | | | | | | | | | | | | | | destroy_bus already has a check for NULL, so we don't need to repeat it here.