summaryrefslogtreecommitdiff
path: root/units
AgeCommit message (Collapse)Author
2017-04-23meson: install the dbus aliases for resolve1 and network1 in /etcZbigniew Jędrzejewski-Szmek
This way when the units are disabled, their dbus activation is also disabled. v2: - fix the symlink location
2017-04-23meson: use "sh -eu" and make .sh +x, .py -xZbigniew Jędrzejewski-Szmek
Shell scripts should be executable so that meson reports their invocation succinctly (does not print 'sh' '-e'). Python scripts should not be executable so that meson does the detection of the right python binary itself. Add -u everywhere to catch potential errors.
2017-04-23meson: reindent all files with 8 spacesZbigniew Jędrzejewski-Szmek
The indentation for emacs'es meson-mode is added .dir-locals. All files are reindented automatically, using the lasest meson-mode from git. Indentation should now be fairly consistent.
2017-04-23meson: fix condition for installation of .in units, 99-default.linkZbigniew Jędrzejewski-Szmek
The condition to install in_units was calculated, but not used. 99-default.link should be installed uncoditionally.
2017-04-23meson: use join_paths consistentlyMichael Biebl
With -Dsplit-usr=true, we set rootprefix to /. This leads to //lib/systemd or //lib/udev for various dir variables. Using join_paths() avoids this.
2017-04-23meson: rework processing of unit filesZbigniew Jędrzejewski-Szmek
Ideally, we would chain the m4 processing, .in substitutions, and file installation so that the commands don't have to be repeated. Unfortunately this does not seem currently possible, because custom_target() output cannot be fed into install_data(), so it's necessary to use the 'install', 'install_dir' arguments to control installation. Nevertheless, rework the rules to repeat less stuff and unify handling of conditions between the different file types.
2017-04-23meson: support (the removal of) lines with ##Zbigniew Jędrzejewski-Szmek
2017-04-23meson: create various symlinksZbigniew Jędrzejewski-Szmek
v2: - remove bashisms
2017-04-23meson: create dirs and touch /usrZbigniew Jędrzejewski-Szmek
This is the equivalent of $(INSTALL_DIRS) and install-touch-usr-hook. I did not bother to create the directories into which we install files, since they will be created anyway. v2: - remove bashism
2017-04-23meson: add unit installation symlinksZbigniew Jędrzejewski-Szmek
This is the equivalent of $(SYSTEM_UNIT_ALIASES) and $(GENERAL_ALIASES) in Makefile.am. ninja-build uninstall does not remove the symlinks, see https://github.com/mesonbuild/meson/issues/1602. I don't consider this a blocker: after all either one installs into $DESTDIR, where uninstallation doesn't make much sense, or into a real system, where a successfull uninstallation would likely destroy the system. v2: - remove bashisms - add various forgotten symlinks and fix service/timer/target confusions
2017-04-23meson: build systemd using mesonZbigniew Jędrzejewski-Szmek
It's crucial that we can build systemd using VS2010! ... er, wait, no, that's not the official reason. We need to shed old systems by requring python 3! Oh, no, it's something else. Maybe we need to throw out 345 years of knowlege accumulated in autotools? Whatever, this new thing is cool and shiny, let's use it. This is not complete, I'm throwing it out here for your amusement and critique. - rules for sd-boot are missing. Those might be quite complicated. - rules for tests are missing too. Those are probably quite simple and repetitive, but there's lots of them. - it's likely that I didn't get all the conditions right, I only tested "full" compilation where most deps are provided and nothing is disabled. - busname.target and all .busname units are skipped on purpose. Otherwise, installation into $DESTDIR has the same list of files and the autoconf install, except for .la files. It'd be great if people had a careful look at all the library linking options. I added stuff until things compiled, and in the end there's much less linking then in the old system. But it seems that there's still a lot of unnecessary deps. meson has a `shared_module` statement, which sounds like something appropriate for our nss and pam modules. Unfortunately, I couldn't get it to work. For the nss modules, we need an .so version of '2', but `shared_module` disallows the version argument. For the pam module, it also didn't work, I forgot the reason. The handling of .m4 and .in and .m4.in files is rather awkward. It's likely that this could be simplified. If make support is ever dropped, I think it'd make sense to switch to a different templating system so that two different languages and not required, which would make everything simpler yet. v2: - use get_pkgconfig_variable - use sh not bash - use add_project_arguments v3: - drop required:true and fix progs/prog typo v4: - use find_library('bz2') - add TTY_GID definition - define __SANE_USERSPACE_TYPES__ - use join_paths(prefix, ...) is used on all paths to make them all absolute v5: - replace all declare_dependency's with [] - add more conf.get guards around optional components v6: - drop -pipe, -Wall which are the default in meson - use compiler.has_function() and compiler.has_header_symbol instead of the hand-rolled checks. - fix duplication in 'liblibsystemd' library name - use the right .sym file for pam_systemd - rename 'compiler' to 'cc': shorter, and more idiomatic. v7: - use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D - rename prefix to prefixdir, rootprefix to rootprefixdir ("prefix" is too common of a name and too easy to overwrite by mistake) - wrap more stuff with conf.get('ENABLE...') == 1 - use rootprefix=='/' and rootbindir as install_dir, to fix paths under split-usr==true. v8: - use .split() also for src/coredump. Now everything is consistent ;) - add rootlibdir option and use it on the libraries that require it v9: - indentation v10: - fix check for qrencode and libaudit v11: - unify handling of executable paths, provide options for all progs This makes the meson build behave slightly differently than the autoconf-based one, because we always first try to find the executable in the filesystem, and fall back to the default. I think different handling of loadkeys, setfont, and telinit was just a historical accident. In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs. In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin), but in Debian, those directories are not included in the path. C.f. https://github.com/mesonbuild/meson/issues/1576. - call all the options 'xxx-path' for clarity. - sort man/rules/meson.build properly so it's stable
2017-04-21Merge pull request #5756 from keszybz/make-cleanupsMartin Pitt
Various meson-independent cleanups from the meson patchset
2017-04-21units: systemd-resolved should start before network-online.target and ↵Yu Watanabe
nss-lookup.target (#5691) systemd-resolved provides 1. local API via NSS and D-Bus 2. kind of a local "DNS proxy" through its stub listener The 1st item should be started before nss-lookup.target. The 2nd item should be started before network-online.target, because if the networking works in general, then DNS (and DNS proxy) should too. Fixes #5650
2017-04-19Makefile.am: link dbus-org.freedesktop.network1 alias in /etcZbigniew Jędrzejewski-Szmek
This makes dbus-org.freedesktop.network1.service like dbus-org.freedesktop.resolve1.service. When systemd-networkd.service is disabled, the alias is also removed.
2017-04-19units: drop explicit NotifyAccess setting from journald's unit file (#5749)Michal Sekletar
systemd-journald service consists of only single process and that is the MainPID. Make unit file shorter and drop NotifyAccess=all since it is not useful in such case. https://lists.freedesktop.org/archives/systemd-devel/2017-April/038667.html
2017-03-30journal-upload: add state file directory to ReadWritePaths (#5578)Yu Watanabe
The commit c7fb922d6250543ba5462fa7a6ff03cc8f628e94 prohibits journal-upload to save its state in /var/lib/systemd/journal-upload/state, thus the daemon fails and outputs the following error message even if the directory is not read-only file system ```Cannot save state to /var/lib/systemd/journal-upload/state: Read-only file system``` This commit adds the permission the daemon to write the state file.
2017-03-30units: move Before deps for quota services to remote-fs.target (#5627)tblume
Creating quota on an iscsi device is causing dependency loops at next reboot. Reason is that systemd-quotacheck and quotaon.service are ordered before local-fs.target and quota enabled mounts have a before dependency to them. This cannot work for _netdev mounts, because network activation is ordered after local-fs.target. Moving the Before dependency for systemd-quotacheck and quotaon.service to remote-fs.target fixes this.
2017-03-30serial-getty@.service.m4: add Conflicts=/Before= against rescue.service (#5632)Franck Bui
Commit 5ed020d8d10fc100c68edddb519f085b7397a45c already fixed this issue for getty@.service but forgot serial console. Note that this is not needed for emergency target as the sysinit target conflicts against this target already.
2017-03-27units: make enablement of s-n-wait-online.service follow ↵Zbigniew Jędrzejewski-Szmek
systemd-networkd.service (#5635) In 58a6dd15582c038a25bd7059435833943e2e4617 s-n-wait-online.service was added to presets to synchronize the presets with the state after installation. But it is harmful to have s-n-wait-online.service enabled when s-n.service is disabled, because s-n-wait-online.service has Requsite=s-n.service and cannot be activated. Thus remove s-n-wait-online.service from presets again, and let it be enabled whenever s-n.service is enabled. During installation we create enablement symlinks by hand, and since s-n.service is enabled, s-n-w-o.service should be enabled too, so the symlink should still be created during installation. https://bugzilla.redhat.com/show_bug.cgi?id=1433459#c15
2017-03-22units: simplify rescue.service and emergency.service (#5623)Michael Biebl
The emergency.service and rescue.service units have become rather convoluted. We spawn multiple shells and the help text spans multiple lines which makes the units hard to read. Move the logic into a single shell script and call that via ExecStart.
2017-03-20units: apply plymouth warning fix to in rescue mode as well (#5615)Daniel Molkentin
Follow up for #5528.
2017-03-17units: do not throw a warning in emergency mode if plymouth is not installed ↵Daniel Molkentin
(#5528) Ideally, plymouth should only be referenced via dependencies, not ExecStartPre's. This at least avoids the confusing error message on minimal installations that do not carry plymouth.
2017-03-01Merge pull request #5283 from poettering/tighten-sandboxLennart Poettering
Tighten sandbox of long-running services
2017-02-17units: order systemd-nspawn@.service after systemd-resolved.serviceLennart Poettering
This way, the nspawn internal check whether resolved is running will succeed if it is enabled. Fixes: #4649
2017-02-17units: enable resolved bus activation though a symlink in /etcLennart Poettering
The change: -/usr/lib/systemd/system/dbus-org.freedesktop.resolve1.service +/etc/systemd/system/dbus-org.freedesktop.resolve1.service If resolved is disabled, without this, talking to the resolved bus API will activate it regardless whether it is enabled or not, let's fix that.
2017-02-09Introduce '## ' as internal comment prefix in .in files and filter out a ↵Zbigniew Jędrzejewski-Szmek
comment (#5289) Sometimes we have comments which don't make sense outside of the systemd codebase, so let's filter them out from the user-visible files. Fixes #5286.
2017-02-09units: make use of @reboot and @swap in our long-running service ↵Lennart Poettering
SystemCallFilter= settings Tighten security up a bit more.
2017-02-09units: lock down coredump service a bitLennart Poettering
Dissecting a coredump is possibly risky and might take a while, hence lock down the unit as much as we can.
2017-02-09units: turn on ProtectKernelModules= for most long-running servicesLennart Poettering
2017-02-09units: switch on ProtectSystem=strict for our long running servicesLennart Poettering
Let's step up the protection a notch
2017-02-09units: restrict namespace for a good number of our own servicesLennart Poettering
Basically, we turn it on for most long-running services, with the exception of machined (whose child processes need to join containers here and there), and importd (which sandboxes tar in a CLONE_NEWNET namespace). machined is left unrestricted, and importd is restricted to use only "net"
2017-02-09units: set SystemCallArchitectures=native on all our long-running servicesLennart Poettering
2017-01-31units: restore Before dependencies for systemd-vconsole-setup.serviceZbigniew Jędrzejewski-Szmek
When the service is run in the initramfs, it is possible for it to get started and not be fast enough to exit before the root switch happens. It is started multiple times (depending on the consoles being detected), and runs asynchronously, so this is quite likely. It'll then get killed by killall(), and systemd will consider the service failed. To avoid all this, just wait for the service to terminate on it's own. Before=initrd-switch-root.target should be good for the initramfs, and Before=shutdown.tuarget should be good for the real system, although it's unlikely to make any difference there.
2017-01-31units: drop KillMode= from initrd-switch-root.serviceZbigniew Jędrzejewski-Szmek
The service already has DefaultDeps disabled, so systemd should not try to stop it. And if it *does* get stopped, we don't want the zombie process around. KillMode=none does not change anything in the killall() phase, and we already use argv[0][0] = '@' to protect against that anyway. KillMode=none should not be useful in normal operation, so let's leave it out.
2017-01-14Merge pull request #4879 from poettering/systemdZbigniew Jędrzejewski-Szmek
2016-12-29units: fix condition for systemd-journal-catalog-update.service (#4990)Lennart Poettering
The service is supposed to regenerate the catalog index whenever /usr is updated, but /var is not. Hence the ConditionNeedsUpdate= line should actually reference /var, as that's where the index file is located.
2016-12-21fstab-generator: add support for volatile bootsLennart Poettering
This adds support for a new kernel command line option "systemd.volatile=" that provides the same functionality that systemd-nspawn's --volatile= switch provides, but for host systems (i.e. systems booting with a kernel). It takes the same parameter and has the same effect. In order to implement systemd.volatile=yes a new service systemd-volatile-root.service is introduced that only runs in the initrd and rearranges the root directory as needed to become a tmpfs instance. Note that systemd.volatile=state is implemented different: it simply generates a var.mount unit file that is part of the normal boot and has no effect on the initrd execution. The way this is implemented ensures that other explicit configuration for /var can always override the effect of these options. Specifically, the var.mount unit is generated in the "late" generator directory, so that it only is in effect if nothing else overrides it.
2016-12-20units: drop --fail parameter from "systemctl switch-root" invocationLennart Poettering
This parameter has no effect on switch root hence we shouldn't specify it.
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-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 #4710 from martinpitt/networkd-dbusLennart Poettering
networkd: allow networkd to start in early boot
2016-11-23networkd: allow networkd to start in early bootMartin Pitt
With the previous improvements, networkd.service's "After=dbus.service" can now be dropped. That ordering effectively forced networkd.service to run in late boot only (dbus.service was rejected to run in early boot in https://bugs.freedesktop.org/show_bug.cgi?id=98254). Fixes #4504
2016-11-23core: consider SIGTERM as a clean exit status for initrd-switch-root.service ↵Franck Bui
(#4713) Since commit 1f0958f640b8717, systemd considers SIGTERM for short-running services (aka Type=oneshot) as a failure. This can be an issue with initrd-switch-root.service as the command run by this service (in order to switch to the new rootfs) may still be running when systemd does the switch. However PID1 sends SIGTERM to all remaining processes right before switching and initrd-switch-root.service can be one of those. After systemd is reexecuted and its previous state is deserialized, systemd notices that initrd-switch-root.service was killed with SIGTERM and considers this as a failure which leads to the emergency shell. To prevent this, this patch teaches systemd to consider a SIGTERM exit as a clean one for this service. It also removes "KillMode=none" since this is pretty useless as the service is never stopped by systemd but it either exits normally or it's killed by a SIGTERM as described previously.
2016-11-11units: disable /sys/fs/fuse/connections in private user namespaces (#4592)Zbigniew Jędrzejewski-Szmek
The mount fails, even though CAP_SYS_ADMIN is granted. Only file systems with FU_USERNS_MOUNT in .fs_flags may be mounted in userns, and the patch to add that fusectl was rejected [1]. It would be nice if we could check if the kernel has FU_USERNS_MOUNT for a given fs type, since this could change over time, but this information doesn't seem to be exported. So let's just skip this mount in userns to avoid an error during boot. [1] https://patchwork.kernel.org/patch/2828269/
2016-10-27Merge pull request #4442 from keszybz/detect-virt-usernsEvgeny Vereshchagin
detect-virt: add --private-users switch to check if a userns is active; add Condition=private-users
2016-10-26units: disable /dev/hugepages in private user namespacesZbigniew Jędrzejewski-Szmek
The mount fails, even though CAP_SYS_ADMIN is granted.
2016-10-24core: drop -.slice from shipped unitsLennart Poettering
Since this unit is synthesized anyway there's no point in actually shipping it on disk. This also has the benefit that "cd /usr/lib/systemd/system ; ls *" won't be confused by the leading dash of the file name anymore.
2016-10-20sysctl: run sysctl service if /proc/sys/net is writable (#4425)Lennart Poettering
This simply changes this line: ConditionPathIsReadWrite=/proc/sys/ to this: ConditionPathIsReadWrite=/proc/sys/net/ The background for this is that the latter is namespaced through network namespacing usually and hence frequently set as writable in containers, even though the former is kept read-only. If /proc/sys is read-only but /proc/sys/net is writable we should run the sysctl service, as useful settings may be made in this case. Fixes: #4370
2016-10-20units: extend stop timeout for user@.service to 120s (#4426)Lennart Poettering
By default all user and all system services get stop timeouts for 90s. This is problematic as the user manager of course is run as system service. Thus, if the default time-out is hit for any user service, then it will also be hit for user@.service as a whole, thus making the whole concept useless for user services. This patch extends the stop timeout to 120s for user@.service hence, so that that the user service manager has ample time to process user services timing out. (The other option would have been to shorten the default user service timeout, but I think a user service should get the same timeout by default as a system service) Fixes: #4206