summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-12-01nspawn: improve log messagesLennart Poettering
When complaining about the inability to resolve a path, show the full path, not just the relative one. As suggested by @keszybz.
2016-12-01nspawn: optionally, automatically allocated --bind=/--overlay source from ↵Lennart Poettering
/var/tmp This extends the --bind= and --overlay= syntax so that an empty string as source/upper directory is taken as request to automatically allocate a temporary directory below /var/tmp, whose lifetime is bound to the nspawn runtime. In combination with the "+" path extension this permits a switch "--overlay=+/var::/var" in order to use the container's shipped /var, combine it with a writable temporary directory and mount it to the runtime /var of the container.
2016-12-01nspawn: permit prefixing of source paths in --bind= and --overlay= with "+"Lennart Poettering
If a source path is prefixed with "+" it is taken relative to the container's root directory instead of the host. This permits easily establishing bind and overlay mounts based on data from the container rather than the host. This also reworks custom_mounts_prepare(), and turns it into two functions: one custom_mount_check_all() that remains in nspawn.c but purely verifies the validity of the custom mounts configured. And one called custom_mount_prepare_all() that actually does the preparation step, sorts the custom mounts, resolves relative paths, and allocates temporary directories as necessary.
2016-12-01tree-wide: set SA_RESTART for signal handlers we installLennart Poettering
We already set it in most cases, but make sure to set it in all others too, and document that that's a good idea.
2016-12-01nspawn: add ability to configure overlay mounts to .nspawn filesLennart Poettering
Fixes: #4634
2016-12-01nspawn: split out overlayfs argument parsing into a function of its ownLennart Poettering
Add overlay_mount_parse() similar in style to tmpfs_mount_parse() and bind_mount_parse().
2016-12-01nspawn: use -ENOMEM instead of log_oom() in one caseLennart Poettering
The function is of the "library" kind and doesn't log ENOMEM in all other cases, hence fix the one outlier.
2016-12-01nspawn: make use of CHASE_NON_EXISTING when locking imageLennart Poettering
If --template= is used on an image, then the image might not exist initially. We can use CHASE_NON_EXISTING to properly lock the image already before it exists. Let's do so.
2016-12-01nspawn: use the new CHASE_NON_EXISTING flag when resolving mount pointsLennart Poettering
This restores the ability to implicitly create files/directories to mount specified mount points on.
2016-12-01fs-util: add new CHASE_NON_EXISTING flag to chase_symlinks()Lennart Poettering
This new flag controls whether to consider a problem if the referenced path doesn't actually exist. If specified it's OK if the final file doesn't exist. Note that this permits one or more final components of the path not to exist, but these must not contain "../" for safety reasons (or, to be extra safe, neither "./" and a couple of others, i.e. what path_is_safe() permits). This new flag is useful when resolving paths before issuing an mkdir() or open(O_CREAT) on a path, as it permits that the file or directory is created later. The return code of chase_symlinks() is changed to return 1 if the file exists, and 0 if it doesn't. The latter is only returned in case CHASE_NON_EXISTING is set.
2016-12-01fs-util: add flags parameter to chase_symlinks()Lennart Poettering
Let's remove chase_symlinks_prefix() and instead introduce a flags parameter to chase_symlinks(), with a flag CHASE_PREFIX_ROOT that exposes the behaviour of chase_symlinks_prefix().
2016-12-01fs-util: change chase_symlinks() behaviour in regards to escaping the root dirLennart Poettering
Previously, we'd generate an EINVAL error if it is attempted to escape a root directory with relative ".." symlinks. With this commit this is changed so that ".." from the root directory is a NOP, following the kernel's own behaviour where /.. is equivalent to /. As suggested by @keszybz.
2016-12-01test-fs-util: add a test case with repeated ".." parts that would escape the ↵Zbigniew Jędrzejewski-Szmek
root
2016-12-01nspawn: use chase_symlinks() on all paths specified via --tmpfs=, --bind= ↵Lennart Poettering
and so on Fixes: #2860
2016-12-01fs-util: add chase_symlinks_prefix() and extend commentsLennart Poettering
chase_symlinks() currently expects a fully qualified, absolute path, relative to the host's root as first argument. Which is useful in many ways, and similar to the paths unlink(), rename(), open(), … expect. Sometimes it's however useful to first prefix the specified path with the specified root directory. Add a new call chase_symlinks_prefix() for this, that is a simple wrapper.
2016-12-01nspawn: coding style: don't mix variable declarations and function callsLennart Poettering
2016-12-01nspawn: use realloc_multiply() where it makes senseLennart Poettering
2016-12-01nspawn: accept --ephemeral --template= as alternative for --ephemeral ↵Lennart Poettering
--directory= As suggested in PR #3667. This PR simply ensures that --template= can be used as alternative to --directory= when --ephemeral is used, following the logic that for ephemeral options the source directory is actually a template. This does not deprecate usage of --directory= with --ephemeral, as I am not convinced the old logic wouldn't make sense. Fixes: #3667
2016-12-01nspawn: properly handle image/directory paths that are symlinksLennart Poettering
This resolves any paths specified on --directory=, --template=, and --image= before using them. This makes sure nspawn can be used correctly on symlinked images and directory trees. Fixes: #2001
2016-12-01tree-wide: stop using canonicalize_file_name(), use chase_symlinks() insteadLennart Poettering
Let's use chase_symlinks() everywhere, and stop using GNU canonicalize_file_name() everywhere. For most cases this should not change behaviour, however increase exposure of our function to get better tested. Most importantly in a few cases (most notably nspawn) it can take the correct root directory into account when chasing symlinks.
2016-12-01core: make unit_free() accept NULL pointersLennart Poettering
We generally try to make our destructors robust regarding NULL pointers, much in the same way as glibc's free(). Do this also for unit_free(). Follow-up for #4748.
2016-11-30l10n: update line numbers in Czech translation (#4776)AsciiWolf
2016-11-30systemctl: fix 'is-enabled' exit status on failure when executed in chroot ↵Franck Bui
(#4773)
2016-11-30As per use case we should allow ForwardDelaySec to be set as 0 (#4765)Susant Sahani
So let's set ForwardDelaySec to USEC_INFINITY . Reference: https://wiki.linuxfoundation.org/networking/bridge#does-dhcp-work-overthrough-a-bridge
2016-11-30Merge pull request #4772 from martinpitt/hwdbMartin Pitt
parse_hwdb: fix to work with pyparsing 2.1.10
2016-11-30hwdb/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-30parse_hwdb: fix to work with pyparsing 2.1.10Martin Pitt
pyparsing 2.1.10 fixed the handling of LineStart to really just apply to line starts and not ignore whitespace and comments any more. Adjust EMPTYLINE to this. Many thanks to Paul McGuire for pointing this out!
2016-11-30test: retry checking for transient hostname in hostnamectl (#4769)Martin Pitt
Sometimes setting the transient hostname does not happen synchronously, so retry up to five times. It is not yet clear whether this is legitimate behaviour or an underlying bug, but this will at least show whether the wrong transient hostname is just a race condition or permanently wrong. Fixes #4753
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.