summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-12-01hwdb-test: properly print error output from systemd-hwdb updateZbigniew Jędrzejewski-Szmek
Because -e was set, we'd exit immediately when systemd-hwdb failed and the captured error output was never printed. We want to test two things: that 0 is returned, and that nothing is printed to stderr (to catch syntax errors in the hwdb). v2: stop capturing stderr to a variable v3: capture stderr to a variable and test both error types separately
2016-11-30man: describe overriding of entries in hwdb filesZbigniew Jędrzejewski-Szmek
2016-11-30hwdb: rename err to r and use _cleanup_ in two more placesZbigniew Jędrzejewski-Szmek
2016-11-30hwdb: simplify error handling in trie_storeZbigniew Jędrzejewski-Szmek
fclose() can also set errno, so the attempts to protect errno that the code made were not successful. Simplify things by immediately saving errno to r.
2016-11-30sd-hwdb: drop caching of search stringZbigniew Jędrzejewski-Szmek
We have only two callers, and for neither this "optimization" is useful. So let's drop it an save some code and a malloc.
2016-11-30hwdb, sd-hwdb: rework priority comparison when loading propertiesZbigniew Jędrzejewski-Szmek
We cannot compare filenames directly, because paths are not sortable lexicographically, e.g. /etc/udev is "later" (has higher priority) than /usr/lib/udev. The on-disk format is changed to have a separate field for "file priority", which is stored when writing the binary file, and then loaded and used in comparisons. For data in the previous format (as generated by systemd 232), this information is not available, and we use a trick where the offset into the string table is used as a proxy for priority. Most of the time strings are stored in the order in which the files were processed. This is not entirely reliable, but is good enough to properly order /usr/lib and /etc/, which are the two most common cases. This hack is included because it allows proper parsing of files until the binary hwdb is regenerated. Instead of adding a new field, I reduced the size of line_number from 64 to 32 bits, and added a 16 bit priority field, and 16 bits of padding. Adding a new field of 16 bytes would significantly screw up alignment and increase file size, and line number realistically don't need more than ~20 bits. Fixes #4750.
2016-11-30hwdb: remove path comparison which broke overriding of propertiesZbigniew Jędrzejewski-Szmek
Partial fix for #4750. We would compare strings like "/usr/lib/udev/hwdb.d/something.hwdb" and "/etc/udev/hwdb.db/something.hwdb" and conclude that the first has higher priority. Since we process files in order (higher priority later), no comparison is necessary when loading. This partially undoes 3a04b789c6f17dff2000a3cdbeaaf86baa604524 (not in spirit, but in the implementation).
2016-11-29Two small cleanupsZbigniew Jędrzejewski-Szmek
2016-11-30Merge pull request #4745 from joukewitteveen/notifyEvgeny Vereshchagin
Improvements for notify services (including #4212)
2016-11-29service: new NotifyAccess= value for control processes (#4212)Jouke Witteveen
Setting NotifyAccess=exec allows notifications coming directly from any control process.
2016-11-29NEWS: mention more aggressive failing of notify servicesJouke Witteveen
2016-11-29bus-util: add protocol error type explanationJouke Witteveen
2016-11-29cgroup: support prefix "-" in cgroups whitelisting entries (#4687)Dongsu Park
So far systemd-nspawn container has been creating files under /run/systemd/inaccessible, no matter whether it's running in user namespace or not. That's fine for regular files, dirs, socks, fifos. However, it's not for block and character devices, because kernel doesn't allow them to be created under user namespace. It results in warnings at booting like that: ==== Couldn't stat device /run/systemd/inaccessible/chr Couldn't stat device /run/systemd/inaccessible/blk ==== Thus we need to have the cgroups whitelisting handler to silently ignore a file, when the device path is prefixed with "-". That's exactly the same convention used in directives like ReadOnlyPaths=. Also insert the prefix "-" to inaccessible entries.
2016-11-29networkctl: install zsh completion from #3062 (#4767)Gabriel Rauter
zsh autocompletion provided by #3062 will be installed when networkd is enabled.
2016-11-29ima: Write the policy filename into IMA's sysfs policy file (#4766)Stefan Berger
IMA validates file signatures based on the security.ima xattr. As of Linux-4.7, instead of copying the IMA policy into the securityfs policy, the IMA policy pathname can be written, allowing the IMA policy file signature to be validated. This patch modifies the existing code to first attempt to write the pathname, but on failure falls back to copying the IMA policy contents.
2016-11-29Merge pull request #4763 from keszybz/offline-update-loopLennart Poettering
A fix for offline update loop
2016-11-29service: prevent registering control pids as the main pidJouke Witteveen
We assume a process can be only one of the two in service_sigchld_event.
2016-11-29service: only fail notify services on empty cgroup during startJouke Witteveen
We stay in the SERVICE_START while no READY=1 notification message has been received. When we are in the SERVICE_START_POST state, we have already received a ready notification. Hence we should not fail when the cgroup becomes empty in that state.
2016-11-29units: add system-update-cleanup.service to guard against offline-update loopsZbigniew Jędrzejewski-Szmek
Note: the name is "system-update-cleanup.service" rather than "system-update-done.service", because it should not run normally, and also because there's already "systemd-update-done.service", and having them named so similarly would be confusing. In https://bugzilla.redhat.com/show_bug.cgi?id=1395686 the system repeatedly entered system-update.target on boot. Because of a packaging issue, the tool that created the /system-update symlink could be installed without the service unit that was supposed to perform the upgrade (and remove the symlink). In fact, if there are no units in system-update.target, and /system-update symlink is created, systemd always "hangs" in system-update.target. This is confusing for users, because there's no feedback what is happening, and fixing this requires starting an emergency shell somehow, and also knowing that the symlink must be removed. We should be more resilient in this case, and remove the symlink automatically ourselves, if there are no upgrade service to handle it. This adds a service which is started after system-update.target is reached and the symlink still exists. It nukes the symlink and reboots the machine. It should subsequently boot into the default default.target. This is a more general fix for https://bugzilla.redhat.com/show_bug.cgi?id=1395686 (the packaging issue was already fixed).
2016-11-29man: update the description of offline updatesZbigniew Jędrzejewski-Szmek
- use "service" instead of "script", because various offline updaters that we have aren't really scripts, e.g. dnf-plugin-system-upgrade, packagekit-offline-update, fwupd-offline-update. - strongly recommend After=sysinit.target, Wants=sysinit.target - clarify a bit what should happen when multiple update services are started - replace links to the wiki with refs to the man page that replaced it.
2016-11-28Merge pull request #4761 from fsateler/python3Martin Pitt
Explicitly use python3 everywhere
2016-11-28networkd: move event loop handling out of the manager (#4723)Tom Gundersen
This will allow us to have several managers sharing an event loop and running in parallel, as if they were running in separate processes. The long term-aim is to allow networkd to be split into separate processes, so restructure the code to make this simpler. For now we drop the exit-on-idle logic, as this was anyway severely restricted at the moment. Once split, we will revisit this as it may then make more sense again.
2016-11-28Use python3 explicitly in all python scriptsFelipe Sateler
2016-11-28build-sys: explicitly require python3Felipe Sateler
Otherwise python programs might be run with python2
2016-11-28socket-proxyd: Introduced dynamic connection limit via an option. (#4749)(GalaxyMaster)
2016-11-28udevd: check correct return value of fcntl() (#4758)Daniel Wagner
This looks like a copy&paste error from the code block above.
2016-11-28test: make transient hostname tests fail verbosely (#4754)Martin Pitt
This test fails sometimes but it is hard to reproduce, so we need more information what happens. Set journal log level to "debug" for the entirety of networkd-test.py, and show networkd's and hostnamed's journals and the DHCP server log on failure of the two test_transient_hostname* tests. Also sync the journal before querying it to get more precise output. This should help with tracking down issue #4753.
2016-11-27device: Avoid calling unit_free(NULL) in device setup logic (#4748)Dave Reisner
Since a581e45ae8f9bb5c, there's a few function calls to unit_new_for_name which will unit_free on failure. Prior to this commit, a failure would result in calling unit_free with a NULL unit, and hit an assertion failure, seen at least via device_setup_unit: Assertion 'u' failed at src/core/unit.c:519, function unit_free(). Aborting. Fixes #4747 https://bugs.archlinux.org/task/51950
2016-11-27Merge pull request #4736 from dobyrch/calendar-cleanupDjalal Harouni
calendarspec: miscellaneous parsing and formatting fixes
2016-11-25calendarspec: refactor format_chain()Douglas Christman
Factor out repeated references to usec and remove nested ifs.
2016-11-25fix journald startup problem when code is compiled with -DNDEBUG (#4735)Waldemar Brodkorb
Similar to this patch from here: http://systemd-devel.freedesktop.narkive.com/AvfCbi6c/patch-0-3-using-assert-se-on-actions-with-side-effects-on-test-cases If the code is compiled with -DNDEBUG which is the default for some embedded buildsystems, systemd-journald does not startup and silently fails.
2016-11-25Revert "hwdb/parse_hwdb.py: open files with UTF-8 mode"Martin Pitt
"encoding" is not a valid Python 2 keyword, and despite the hashbang this script can be called with Python 2. This reverts commit 115a10c58d343d00b73bd9442f7ce6c294debad8.
2016-11-24calendarspec: rename "eom" to "end_of_month"Douglas Christman
2016-11-24calendarspec: make specifications with ranges reversibleDouglas Christman
"*-*-01..03" is now formatted as "*-*-01..03" instead of "*-*-01,02,03"
2016-11-24calendarspec: allow whole second rangesDouglas Christman
Previously a string like "00:00:01..03" would fail to parse due to the ambiguity between a decimal point and the start of a range.
2016-11-24calendarspec: make specifications with seconds wildcard reversibleDouglas Christman
"*:*:*" is now formatted as "*:*:*" instead of "*:*:00/1"
2016-11-24calendarspec: reject strings with spurious spaces and signsDouglas Christman
strtoul() parses leading whitespace and an optional sign; check that the first character is a digit to prevent odd specifications like "00: 00: 00" and "-00:+00/-1".
2016-11-24calendarspec: reject open weekday rangesDouglas Christman
Forbid open ranges like "Tue.."; trailing commas are still OK.
2016-11-24calendarspec: reject strings that only contain a timezoneDouglas Christman
This makes " UTC" an illegal date specification.
2016-11-24calendarspec: always interpret a missing time as 00:00:00Douglas Christman
"*-*-*" is now equivalent to "*-*-* 00:00:00" (daily) rather than "*-*-* *:*:*" (every second).
2016-11-25Merge pull request #4734 from whot/hwdb-updatesPeter Hutterer
hwdb: add axis overrides for HP Pavilion dv7
2016-11-25hwdb: add axis overrides for HP Pavilion dv7Peter Hutterer
Fixes #4731
2016-11-24core: make sure initrd-switch-root command survives PID1's killing spree (#4730)Franck Bui
This is a different way to implement the fix proposed by commit a4021390fef27f4136497328f suggested by Lennart Poettering. In this patch we instruct PID1 to not kill "systemctl switch-root" command started by initrd-switch-root service using the "argv[0][0]='@'" trick. See: https://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/ for more details. We had to backup argv[0] because argv is modified by dispatch_verb().
2016-11-24Merge pull request #4729 from martinpitt/hwdbMartin Pitt
fix hwdb syntax error and add test for it
2016-11-24tests: add hwdb parsing testMartin Pitt
This calls the built "systemd-hwdb update" on the source tree's hwdb/ in a temporary directory and verifies that there are no error messages.
2016-11-24hwdb: fix syntax error in 60-keyboard.hwdbMartin Pitt
Fixes #4728
2016-11-24hwdb/parse_hwdb.py: open files with UTF-8 modeMartin Pitt
pyparsing uses the system locale by default, which in the case of 'C' (in lots of build environment) will fail with a UnicodeDecodeError. Explicitly open it with UTF-8 encoding to guard against this.
2016-11-24Merge pull request #4710 from martinpitt/networkd-dbusLennart Poettering
networkd: allow networkd to start in early boot
2016-11-23man: document protocol error type for service failures (#4724)Jouke Witteveen
2016-11-23networkd: handle MTU field in IPv6 RA (#4719)Susant Sahani
This patch handles the custom MTU field in IPv6 RA. fixes RFE #4464