summaryrefslogtreecommitdiff
path: root/units
Commit message (Collapse)AuthorAgeFilesLines
* units: stop automount unit when shutting downZbigniew Jędrzejewski-Szmek2021-07-201-0/+1
| | | | | | | | This is currently our only .automount unit. We wouldn't want to trigger it accidentally during shutdown, so let's stop it too. (cherry picked from commit dc16846c26287fd2081eb3c4a73487c9b186e2b7) (cherry picked from commit b1ce5653fac2766c4b4a070fec2126f211d49efa)
* meson: call find_program() once and reuse the variable everywhereZbigniew Jędrzejewski-Szmek2021-05-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson 0.58 has gotten quite bad with emitting a message every time a quoted command is used: Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program xsltproc found: YES (/usr/bin/xsltproc) Configuring custom-entities.ent using configuration Message: Skipping bootctl.1 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping loader.conf.5 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) ... Let's suffer one message only for each command. Hopefully we can silence even this when https://github.com/mesonbuild/meson/issues/8642 is resolved. (cherry picked from commit 596f5101f29c10256208132bfa9c502bf898fd8b)
* units: install dbus-org.freedesktop.oom1.service aliasAnita Zhang2021-05-151-1/+2
| | | | | | Fixes: #18469 (cherry picked from commit b5a80aa9d89cd82e53181cfd3288bba694622786) (cherry picked from commit ae08aef85f8eae26e715d661ef53acfd2c0241f3)
* systemd-coredump: Add conflict with shutdown.targetAlexander Sverdlin2021-05-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise a coredump started at the inconvinient moment can stop shutdown.target leaving the system in a halfway-down state: Pulling in shutdown.target/start from systemd-poweroff.service/start Added job shutdown.target/start to transaction. ... Keeping job shutdown.target/start because of systemd-poweroff.service/start ... [ OK ] Stopped target Remote File Systems. shutdown.target: starting held back, waiting for: systemd-networkd.socket sysinit.target: stopping held back, waiting for: remount_tmp.service systemd-coredump.socket: Incoming traffic ... systemd-coredump@0-243-0.service: Trying to enqueue job systemd-coredump@0-243-0.service/start/replace Added job systemd-coredump@0-243-0.service/start to transaction. Pulling in systemd-journald.socket/start from systemd-coredump@0-243-0.service/start Added job systemd-journald.socket/start to transaction. Pulling in system.slice/start from systemd-journald.socket/start Added job system.slice/start to transaction. Pulling in -.slice/start from system.slice/start Added job -.slice/start to transaction. Pulling in system-systemd\x2dcoredump.slice/start from systemd-coredump@0-243-0.service/start Added job system-systemd\x2dcoredump.slice/start to transaction. Pulling in system.slice/start from system-systemd\x2dcoredump.slice/start Pulling in shutdown.target/stop from system-systemd\x2dcoredump.slice/start Added job shutdown.target/stop to transaction. ... Keeping job systemd-poweroff.service/stop because of umount.target/stop Keeping job shutdown.target/stop because of systemd-coredump@0-243-0.service/start (cherry picked from commit 4e947bd04944e58df4103eee4cb8180b5008f143) (cherry picked from commit e11d3ec13c1ee7af65893e94d09d8b3b66cd99c9)
* units: typo fix /proc/<pid>/exec → /proc/<pid>/exeLennart Poettering2020-11-251-2/+2
| | | | | Fix a pretty relevant typo introduced in c7faa23235694a1e803ba093cba6d6e0193a093e.
* units: document why CAP_SYS_PTRACE is needed by journaldFranck Bui2020-11-251-1/+5
|
* unit: update comment about OOM scoreYu Watanabe2020-11-231-1/+1
| | | | Follow-up for 6b2229c6c60d0486f5eb9ed3088f9c780d7c0233.
* units: restore sysfs conditions in sys-fs-fuse-connections.mount and ↵Franck Bui2020-11-212-0/+2
| | | | | | | | | | | | | | | sys-kernel-config.mount Commit 42cc2855ba2fe4c6f5d incorrectly removed the condition on sysfs in both sys-fs-fuse-connections.mount and sys-kernel-config.mount. However there are still needed in case modprobe of one of these modules is intentionally skipped (due to lack of privs for example). This patch restores the 2 conditions which should be safe for the common case, since all conditions are only checked after all deps ordered before are complete. Follow-up for 42cc2855ba2fe4c6f5dc863507a1c843611350a0.
* units: wait until some fs modules are entirely loaded before mounting their ↵Franck Bui2020-11-192-4/+16
| | | | | | | | | | | | | | | | | | | | | corresponding filesystem udev requests to start the fs mount units when their respective module is loaded. For that it monitors uevents of type "ADD" for the relevant fs modules. However the uevent is sent by the kernel too early, ie before the init() of the module is called hence before directories in /sys/fs/ are created. This patch workarounds adds "Requires/After=modprobe@<fs-module>.service" to the mount unit, which means that modprobe(8) will be called once the fs module is announced to be loaded. This sounds pointless, but given that modprobe only returns after the initialization of the module is complete, it should workaround the issue. As a side effect, the module will be automatically loaded if the mount unit is started manually. Fixes #17586.
* Revert "units: skip modprobe@.service if the unit appears to be already loaded"Franck Bui2020-11-191-1/+0
| | | | | | | | | | | | This reverts commit 9cbf1e58f9629af5c6b56777ee73dc6320306d6d. The presence of /sys/module/%I directory can't be used to assert that the load of a given module is complete and therefore the call to modprobe(8) can be skipped. Indeed this directory is created before the init() function of the module is called. Users of modprobe@.service needs to be sure that once this service returns the module is fully operational.
* meson: add option to skip installing to $sysconfdirJörg Thalheim2020-11-121-3/+5
| | | | | | | | | | | | | | | | | | | | | This is useful for development where overwriting files out side the configured prefix will affect the host as well as stateless systems such as NixOS that don't let packages install to /etc but handle configuration on their own. Alternative to https://github.com/systemd/systemd/pull/17501 tested with: $ mkdir inst build && cd build $ meson \ -Dcreate-log-dirs=false \ -Dsysvrcnd-path=$(realpath ../inst)/etc/rc.d \ -Dsysvinit-path=$(realpath ../inst)/etc/init.d \ -Drootprefix=$(realpath ../inst) \ -Dinstall-sysconfdir=false \ --prefix=$(realpath ../inst) .. $ ninja install
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-123-3/+3
| | | | Follow-up for db9ecf050165fd1033c6f81485917e229c4be537.
* Merge pull request #16603 from benzea/benzea/special-app-sliceLennart Poettering2020-11-116-0/+44
|\ | | | | Use app.slice by default in user manager (and define special user slices)
| * units: Move user tmpfiles clean service into background.sliceBenjamin Berg2020-10-231-0/+1
| |
| * units: Add special Desktop Environment user related unitsBenjamin Berg2020-10-235-0/+43
| | | | | | | | This adds app.slice, session.slice and background.slice.
* | license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-09199-199/+199
| |
* | Merge pull request #17467 from keszybz/unconditionally-pull-in-cryptsetup-remoteZbigniew Jędrzejewski-Szmek2020-10-282-22/+4
|\ \ | | | | | | Unconditionally pull in cryptsetup-remote.target in the initramfs
| * | units: unconditionally pull in remote-cryptsetup.target in the initramfsJonathan Lebon2020-10-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [zjs: Replaces #17149. I took half of the patch in https://github.com/systemd/systemd/pull/17149#issuecomment-698399194, hence I'm keeping Jonathan's authorship. The original reasoning for 6c5496c492a8d74e54d22bf8824160cab1e63c10 was that we enable remote-cryptsetup.target via presets, and since presets are not used for the initrd, we need a different target. But since parts of the unit and target tree are shared between the initramfs and the main system, we can't just create a separate target for the initramfs. All the targets that depend on this one would need to be split also. That condition is true for initrd-fs.target, but not for sysinit.target. So let's instead just uncoditionally pull in remote-cryptsetup.target in the initramfs. It should normally be empty, so there should be no impact on boots that don't have units in the target. Jonathan's patch used initrd-root-fs.target, this version instead uses initrd-root-device.target. initrd-root-device.target is ordered before sysroot.mount, which means that the decrypted devices will be available earlier too.]
| * | Revert "units: add initrd-cryptsetup.target"Zbigniew Jędrzejewski-Szmek2020-10-272-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6c5496c492a8d74e54d22bf8824160cab1e63c10. sysinit.target is shared between the initrd and the host system. Pulling in initrd-cryptsetup.target into sysinit.target causes the following warning at boot: Oct 27 10:42:30 workstation-uefi systemd[1]: initrd-cryptsetup.target: Starting requested but asserts failed. Oct 27 10:42:30 workstation-uefi systemd[1]: Assertion failed for initrd-cryptsetup.target.
| * | meson: simplify with_runlevels ternany op usageZbigniew Jędrzejewski-Szmek2020-10-271-2/+2
| |/
* | units: turn on timestamping for journald socketsLennart Poettering2020-10-272-5/+7
|/ | | | | | | To make things simple and robust when debugging journald, we'll leave the SO_TIMESTAMP invocations in the C code in place, even if they are now typically redundant, given that the sockets are already passed into the process with SO_TIMESTAMP turned on now.
* units: add initrd-cryptsetup.targetJonathan Lebon2020-10-212-0/+19
| | | | | | | | | | | | | | | | | | For encrypted block devices that we need to unlock from the initramfs, we currently rely on dracut shipping `cryptsetup.target`. This works, but doesn't cover the case where the encrypted block device requires networking (i.e. the `remote-cryptsetup.target` version). That target however is traditionally dynamically enabled. Instead, let's rework things here by adding a `initrd-cryptsetup.target` specifically for initramfs encrypted block device setup. This plays the role of both `cryptsetup.target` and `remote-cryptsetup.target` in the initramfs. Then, adapt `systemd-cryptsetup-generator` to hook all generated services to this new unit when running from the initrd. This is analogous to `systemd-fstab-generator` hooking all mounts to `initrd-fs.target`, regardless of whether they're network-backed or not.
* Merge pull request #16939 from Rahix/robust-first-boot-machine-idYu Watanabe2020-10-205-4/+21
|\ | | | | Make ConditionFirstBoot safe against power failures
| * units: order systemd-random-seed.service before first-boot-complete.targetHarald Seiler2020-10-191-1/+2
| | | | | | | | | | | | Ensure that systemd-random-seed.service has completed before marking a first boot as completed to guarantee that a saved seed will only be used after it has been initialized at least once.
| * units: order systemd-firstboot.service before first-boot-complete.targetHarald Seiler2020-10-191-1/+2
| | | | | | | | | | | | | | Make sure systemd-firstboot completes before reaching first-boot-complete.target and thus marking the first boot as completed. This way, it is guaranteed that systemd-firstboot has a chance to complete provisioning at least once, even in cases of the first boot getting aborted early.
| * units: add first-boot-complete.target for first boot orderingHarald Seiler2020-10-193-2/+17
| | | | | | | | | | | | | | Add a new target for synchronizing units that wish to run once during the first boot of the system. The machine-id will be committed to disk only after the target has been reached, thus ensuring that all units ordered before it had a chance to complete.
* | Merge pull request #17390 from keszybz/logind-notifications-and-linksYu Watanabe2020-10-201-1/+1
|\ \ | | | | | | Fix sd_notify() usage in various daemons and update some documentation links
| * | tree-wide: update web link to logind descriptionZbigniew Jędrzejewski-Szmek2020-10-191-1/+1
| |/ | | | | | | | | https://www.freedesktop.org/wiki/Software/systemd/multiseat/ says that it is obsoleted by sd-login(3), so it doesn't make much sense to link to the former.
* | units: drop ConditionCapability from systemd-oomd.serviceAnita Zhang2020-10-191-1/+0
|/ | | | Another suggestion from #15206
* Merge pull request #15206 from anitazha/systoomd-v0Zbigniew Jędrzejewski-Szmek2020-10-152-0/+56
|\ | | | | systemd-oomd
| * systemd-oomd: service filesAnita Zhang2020-10-072-0/+56
| |
* | units: update serial-getty@.service to support 57600 baud rateBjørn Mork2020-10-131-1/+1
|/ | | | Fixes: #17306
* homed: explicitly deactivate all home directories on shutdownLennart Poettering2020-09-303-1/+25
| | | | | | | | | | | | | | | | | | | | Let's explicitly deactivate all home dirs on shutdown, in order to properly synchronizing unmounting and avoiding blocking devices. Previously, we'd rely on automatic deactivation when home directories become unused. However, that scheme is asynchronous, and ongoing deactviations might conflicts with attempts to unmount /home. Let's fix that by providing an explicit service systemd-homed-activate.service whose only job is to have a ExecStop= line that explicitly deactivates all home directories on shutdown. This service can the be ordered after home.mount and similar, ensuring that we'll first deactivate all homes before deactivating /home itself during shutdown. This is kept separate from systemd-homed.service so that it is possible to restart systemd-homed.service without deactivating all home directories. Fixes: #16842
* man,units: link to the new dbus-api man pagesZbigniew Jędrzejewski-Szmek2020-09-308-11/+22
|
* units: pass CAP_SYS_RESOURCE to homedLennart Poettering2020-09-181-1/+1
| | | | | | | The ext4 fs resize ioctl needs CAP_SYS_RESOURCE, irritatingly. Let's grant it to homed hence. Fixes: #15115
* meson: RC_LOCAL_SCRIPT_PATH_START to RC_LOCAL_PATHZbigniew Jędrzejewski-Szmek2020-09-151-4/+4
| | | | | | | RC_LOCAL_SCRIPT_PATH_START and RC_LOCAL_SCRIPT_PATH_STOP were was originally added in the conversion to meson based on the autotools name. In 44508946534eee032927c263b79464832656dd6e RC_LOCAL_SCRIPT_PATH_STOP was dropped. We don't need to use such a long name.
* unit: declare BusName= in all our units that are on the bus, event if they ↵Lennart Poettering2020-09-113-0/+3
| | | | | | | don't use Type=dbus This information is always useful, so let's always declare it, particular in the light of #16976.
* Merge pull request #16850 from mbiebl/networkd-socket-activationMichael Biebl2020-08-291-2/+2
|\ | | | | networkd: use socket activation when starting networkd
| * networkd: use socket activation when starting networkdMichael Biebl2020-08-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add After=systemd-networkd.socket to avoid a race condition and networkd falling back to the non-socket activation code. Also add Wants=systemd-networkd.socket, so the socket is started when networkd is started via `systemctl start systemd-networkd.service`. A Requires is not strictly necessary, as networkd still ships the non-socket activation code. Should this code be removed one day, the Wants should be bumped to Requires accordingly. See also 5544ee85163733eaa50f598fcf3bd9421d4a42f9. Fixes: #16809
* | units: add missing usb-gadget.targetKyle Russell2020-08-281-0/+1
|/
* units: turn on ProtectProc= wherever suitableLennart Poettering2020-08-2411-12/+22
|
* units: order volatile-root after repartLennart Poettering2020-08-111-1/+1
| | | | | | | | Let's make sure systemd-repart can still see the real device before we replace its mount with an overlay mount, and thus order repart before volatile-root. See: https://lists.freedesktop.org/archives/systemd-devel/2020-July/044896.html
* units: order systemd-user-sessions.service after home.mountLennart Poettering2020-08-071-1/+1
| | | | | | | | | | | | | | This should make /home as automount work reasonably well. If /home is an automount this has little effect at boot, because if the automount is not triggered it doesn't matter how the associated mount is ordered. It does matter at shutdown however, where home.mount is likely active now. There the ordering means we'll end sessions first, and only then deactivate home.mount. Fixes: #16291
* units: downgrade Requires= to Wants=Lennart Poettering2020-07-291-1/+1
| | | | | | | | | Combining Requires= with Before= doesn't really make sense, since this means we are requiring something that runs after us, which logically cannot be fulfilled. Let's hence downgrade Requires= to Wants= so that the ordering is kept but no failure propagation implied.
* units: upgrade initrd check Conditions to AssertsLennart Poettering2020-07-2910-10/+10
| | | | | It's a bug if an initrd unit is run on the host. Hence let's upgrade the conditions to asserts.
* Bump /tmp size back to 50% of RAMZbigniew Jędrzejewski-Szmek2020-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This should be enough to fix https://bugzilla.redhat.com/show_bug.cgi?id=1856514. But the limit should be significantly higher than 10% anyway. By setting a limit on /tmp at 10% we'll break many reasonable use cases, even though the machine would deal fine with a much larger fraction devoted to /tmp. (In the first version of this patch I made it 25% with the comment that "Even 25% might be too low.". The kernel default is 50%, and we have been using that seemingly without trouble since https://fedoraproject.org/wiki/Features/tmp-on-tmpfs. So let's just make it 50% again.) See 7d85383edbab73274dc81cc888d884bb01070bc2. (Another consideration is that we learned from from the whole initiative with zram in Fedora that a reasonable size for zram is 0.5-1.5 of RAM, and that pretty much all systems benefit from having zram or zswap enabled. Thus it is reasonable to assume that it'll become widely used. Taking the usual compression effectiveness of 0.2 into account, machines have effective memory available of between 1.0 - 0.2*0.5 + 0.5 = 1.4 (for zram sized to 0.5 of RAM) and 1.0 - 0.2*1.5 + 1.5 = 2.2 (for zram 1.5 sized to 1.5 of RAM) times RAM size. This means that the 10% was really like 7-4% of effective memory.) A comment is added to mount-util.h to clarify that tmp.mount is separate.
* Revert "units: drop OnFailure= from .target units"Zbigniew Jędrzejewski-Szmek2020-07-225-0/+10
| | | | | | | | | | | | | This reverts commit c7220ca8025e8dbded36131b23a502d975c45754. The removal was done as a reaction to the messages from systemd: initrd-root-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). initrd.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). initrd-root-device.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). initrd-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). local-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). ... But it seems that the messages themselves are wrong, and the units were OK.
* build: skip installation of 2 files if feature is disabledNorbert Lange2020-07-181-1/+1
| | | | | dont install systemd-update-utmp if utmp is disabled. dont install systemd-initctl.service if sysv is disabled.
* units: tweak udev unit descriptionsLennart Poettering2020-06-083-3/+3
|
* units: uppercase the descriptionZbigniew Jędrzejewski-Szmek2020-06-021-1/+1
| | | | https://github.com/systemd/systemd/pull/15982#pullrequestreview-422536495