systemd/units
Zbigniew Jędrzejewski-Szmek 7c0e2b5559 units: add ordering dependencies on initrd-switch-root.target
For shutdown, we queue shutdown.target/start, so in every unit which should be
stopped *before* shutdown, we need both Conflicts and an ordering dependency
with shutdown.target (either Before= or After= would work, because stop jobs
are always ordered before start jobs).

For initrd transition, we queue initrd-switch-root.service/isolate. This
automatically creates a /stop job for every running unit without
IgnoreOnIsolate. But no ordering dependency is created, unless the unit has a
(possibly transitive) ordering dependency on initrd-switch-root.service.
Since most units must stop before the transition, we should add the ordering
dependency. It is nicer to use Before=initrd-switch-root.target for this.
initrd-switch-root.target is ordered before initrd-switch-root.service, so
the effect it the same when both are in a transaction.

Fixes #23745.

To also cover the case where somebody is emergency mode in the initrd and
queues initrd-switch-root.service/start (not isolate), also add
Conflicts=initrd-switch-root.target, so various units are stopped properly.
This extends 2525682565 to cover all the other
services that are touched. It could be consider "operator error", but it's
easy to make and it's nicer if we can make this more foolproof.
2022-09-15 14:59:11 +02:00
..
user user: delegate cpu controller, assign weights to user slices 2022-07-05 14:40:01 +02:00
user-.slice.d logind: don't delay login for root even if systemd-user-sessions.service is not activated yet 2022-07-12 22:54:39 +01:00
user@.service.d logind: don't delay login for root even if systemd-user-sessions.service is not activated yet 2022-07-12 22:54:39 +01:00
user@0.service.d tree-wide: fix typo 2022-07-20 13:15:37 +09:00
basic.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
blockdev@.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
bluetooth.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
boot-complete.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
console-getty.service.in units: Simplify container getty handling 2022-07-28 21:30:53 +02:00
container-getty@.service.in units: Simplify container getty handling 2022-07-28 21:30:53 +02:00
cryptsetup-pre.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
cryptsetup.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
debug-shell.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
dev-hugepages.mount tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
dev-mqueue.mount license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
emergency.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
emergency.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
exit.target logind, units: unit Descriptions should be capitalized 2021-06-30 13:25:16 +02:00
factory-reset.target units: fix factory-reset.target description 2022-03-14 22:39:32 +00:00
final.target units: correct description of final.target 2021-07-02 18:29:54 +02:00
first-boot-complete.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
getty-pre.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
getty.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
getty@.service.in getty: Pass tty to use by agetty via stdin 2021-11-05 21:32:11 +00:00
graphical.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
halt.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
hibernate.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
hybrid-sleep.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
initrd-cleanup.service license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
initrd-fs.target units: change order of settings to match order in other similar unit 2021-04-20 19:11:07 +02:00
initrd-parse-etc.service.in initrd-parse-etc: override argv[0] to avoid dracut issue 2022-08-18 10:27:44 +02:00
initrd-root-device.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
initrd-root-fs.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
initrd-switch-root.service units: reorder/split unit dependency blocks 2022-09-15 14:59:11 +02:00
initrd-switch-root.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
initrd-udevadm-cleanup-db.service license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
initrd-usr-fs.target fstab-generator: if usr= is specified, mount it to /sysusr/usr/ first 2021-04-20 18:26:17 +02:00
initrd.target fstab-generator: if usr= is specified, mount it to /sysusr/usr/ first 2021-04-20 18:26:17 +02:00
integritysetup-pre.target Add stand-alone dm-integrity support 2021-10-15 10:19:54 -05:00
integritysetup.target Add stand-alone dm-integrity support 2021-10-15 10:19:54 -05:00
kexec.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
kmod-static-nodes.service.in units: shorten description of kmod-static-nodes.service 2021-06-30 13:25:16 +02:00
ldconfig.service units: add ordering dependencies on initrd-switch-root.target 2022-09-15 14:59:11 +02:00
local-fs-pre.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
local-fs.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
machine.slice license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
machines.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
meson-add-wants.sh tools: shellcheck-ify tool scripts 2021-09-30 12:27:06 +02:00
meson.build units/initrd-parse-etc.service: only start units that are required 2022-07-23 19:02:39 +02:00
modprobe@.service units: remove the restart limit on the modprobe@.service 2022-06-21 18:15:34 +02:00
multi-user.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
network-online.target tree-wide: replace obsolete wiki links with systemd.io/manpages 2022-05-21 14:29:14 +02:00
network-pre.target tree-wide: replace obsolete wiki links with systemd.io/manpages 2022-05-21 14:29:14 +02:00
network.target tree-wide: replace obsolete wiki links with systemd.io/manpages 2022-05-21 14:29:14 +02:00
nss-lookup.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
nss-user-lookup.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
paths.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
poweroff.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
printer.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
proc-sys-fs-binfmt_misc.automount tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
proc-sys-fs-binfmt_misc.mount tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
quotaon.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
rc-local.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
reboot.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
remote-cryptsetup.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
remote-fs-pre.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
remote-fs.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
remote-veritysetup.target dm-verity: Remove usage of integrity 2021-10-14 12:17:02 -05:00
rescue.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
rescue.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
rpcbind.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
serial-getty@.service.in getty: Pass tty to use by agetty via stdin 2021-11-05 21:32:11 +00:00
shutdown.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
sigpwr.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
sleep.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
slices.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
smartcard.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
sockets.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
sound.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
suspend-then-hibernate.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
suspend.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
swap.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
sys-fs-fuse-connections.mount tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
sys-kernel-config.mount tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
sys-kernel-debug.mount tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
sys-kernel-tracing.mount tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
sysinit.target units: reorder/split unit dependency blocks 2022-09-15 14:59:11 +02:00
syslog.socket license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
system-systemd\x2dcryptsetup.slice man: document system-systemd\x2dcryptsetup.slice 2021-04-09 10:38:09 +02:00
system-update-cleanup.service license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
system-update-pre.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
system-update.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-ask-password-console.path units: reorder/split unit dependency blocks 2022-09-15 14:59:11 +02:00
systemd-ask-password-console.service units: add ordering dependencies on initrd-switch-root.target 2022-09-15 14:59:11 +02:00
systemd-ask-password-wall.path units: reorder/split unit dependency blocks 2022-09-15 14:59:11 +02:00
systemd-ask-password-wall.service unit: use alias name of man page 2021-06-15 12:14:26 +01:00
systemd-backlight@.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-binfmt.service.in tree-wide: link to docs.kernel.org for kernel documentation 2022-07-04 19:56:53 +02:00
systemd-bless-boot.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-boot-check-no-failures.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-boot-system-token.service units: add ordering dependencies on initrd-switch-root.target 2022-09-15 14:59:11 +02:00
systemd-boot-update.service boot: optionally update sd-boot on boot 2021-07-30 17:19:55 +02:00
systemd-coredump.socket systemd-coredump: Add conflict with shutdown.target 2021-04-29 21:45:23 +02:00
systemd-coredump@.service.in coredump: analyze object with libdwelf in forked process 2021-11-30 16:49:58 +00:00
systemd-exit.service license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-firstboot.service Revert "sysusers/firstboot: temporarily disable LoadCredential" 2021-05-03 12:16:35 +09:00
systemd-fsck-root.service.in fsck: no emergency.target on nofail mounts 2021-11-10 11:58:12 +01:00
systemd-fsck@.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-halt.service units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
systemd-hibernate-resume@.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-hibernate.service.in unit: use alias name of man page 2021-06-15 12:14:26 +01:00
systemd-homed-activate.service license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-homed.service.in units: prolong the stop timeout for homed 2022-09-05 15:22:53 +02:00
systemd-hostnamed.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-hwdb-update.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-hybrid-sleep.service.in unit: use alias name of man page 2021-06-15 12:14:26 +01:00
systemd-importd.service.in units: make sure importd has CAP_LINUX_IMMUTABLE flag 2021-05-22 16:02:02 +09:00
systemd-initctl.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-initctl.socket unit: use alias name of man page 2021-06-15 12:14:26 +01:00
systemd-journal-catalog-update.service license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-journal-flush.service units: we need systemd-journald.service from systemd-journal-flush.service 2022-02-02 05:09:39 +09:00
systemd-journal-gatewayd.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-journal-gatewayd.socket license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-journal-remote.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-journal-remote.socket license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-journal-upload.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-journald-audit.socket license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-journald-dev-log.socket units: add IgnoreOnIsolate=yes to systemd-journald too 2022-07-01 14:17:33 +09:00
systemd-journald-varlink@.socket license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-journald.service.in units: add IgnoreOnIsolate=yes to systemd-journald too 2022-07-01 14:17:33 +09:00
systemd-journald.socket units: add IgnoreOnIsolate=yes to systemd-journald too 2022-07-01 14:17:33 +09:00
systemd-journald@.service.in journald: when journald namespace instances log, they can do so safely to the main journald instance 2021-06-09 12:30:22 +09:00
systemd-journald@.socket license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-kexec.service unit: use alias name of man page 2021-06-15 12:14:26 +01:00
systemd-localed.service.in units: generate ReadWritePaths= in the template 2021-05-19 10:25:26 +09:00
systemd-logind.service.in logind: add a comment with a reminder why we don't use ProtrectProc= 2021-12-17 21:34:20 +09:00
systemd-machine-id-commit.service license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-machined.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-modules-load.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-network-generator.service.in units: add ordering dependencies on initrd-switch-root.target 2022-09-15 14:59:11 +02:00
systemd-networkd-wait-online.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-networkd-wait-online@.service.in unit: introduce wait-online@.service for specific interface 2022-01-28 12:52:52 +00:00
systemd-networkd.service.in network/tuntap: save tun or tap file descriptor in fd store 2022-08-16 21:57:35 +09:00
systemd-networkd.socket systemd-networkd.socket: Add conflict with shutdown.target (#19348) 2021-04-19 11:25:33 +09:00
systemd-nspawn@.service.in units: drop After=systemd-resolved.service from systemd-nspawn@.service 2022-02-24 10:37:11 +01:00
systemd-oomd.service.in oom: Add support for user unit ManagedOOM property updates 2021-09-20 13:53:11 +01:00
systemd-oomd.socket oom: Add support for user unit ManagedOOM property updates 2021-09-20 13:53:11 +01:00
systemd-portabled.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-poweroff.service units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
systemd-pstore.service.in pstore: Run after modules are loaded 2022-06-14 10:17:20 +09:00
systemd-quotacheck.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-random-seed.service.in units: skip some units in the initrd 2021-05-22 15:58:40 +09:00
systemd-reboot.service units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
systemd-remount-fs.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-repart.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-resolved.service.in units: move resolved to sysinit.target (from basic.target) 2022-02-24 10:36:47 +01:00
systemd-rfkill.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-rfkill.socket license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-suspend-then-hibernate.service.in unit: use alias name of man page 2021-06-15 12:14:26 +01:00
systemd-suspend.service.in units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
systemd-sysctl.service.in sysctl: also process sysctl requests via the "sysctl.extra" credential 2022-07-14 18:02:58 +02:00
systemd-sysext.service units: add ordering dependencies on initrd-switch-root.target 2022-09-15 14:59:11 +02:00
systemd-sysupdate-reboot.service.in unit: add units for new "systemd-sysupdate" tool 2022-03-19 00:13:55 +01:00
systemd-sysupdate-reboot.timer unit: add units for new "systemd-sysupdate" tool 2022-03-19 00:13:55 +01:00
systemd-sysupdate.service.in unit: add units for new "systemd-sysupdate" tool 2022-03-19 00:13:55 +01:00
systemd-sysupdate.timer spelling: weekday names are capitalized 2022-03-21 12:16:54 +01:00
systemd-sysusers.service units: add ordering dependencies on initrd-switch-root.target 2022-09-15 14:59:11 +02:00
systemd-time-wait-sync.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-timedated.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-timesyncd.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-tmpfiles-clean.service units: add ordering dependencies on initrd-switch-root.target 2022-09-15 14:59:11 +02:00
systemd-tmpfiles-clean.timer units: skip some units in the initrd 2021-05-22 15:58:40 +09:00
systemd-tmpfiles-setup-dev.service units: add ordering dependencies on initrd-switch-root.target 2022-09-15 14:59:11 +02:00
systemd-tmpfiles-setup.service units: add ordering dependencies on initrd-switch-root.target 2022-09-15 14:59:11 +02:00
systemd-udev-settle.service license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemd-udev-trigger.service unit: prioritize module devices 2022-07-01 15:47:45 +02:00
systemd-udevd-control.socket unit: use alias name of man page 2021-06-15 12:14:26 +01:00
systemd-udevd-kernel.socket unit: use alias name of man page 2021-06-15 12:14:26 +01:00
systemd-udevd.service.in udev: run the main process, workers, and spawned commands in /udev subcgroup 2022-03-17 20:24:38 +09:00
systemd-update-done.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-update-utmp-runlevel.service.in units: adjust description of systemd-update-utmp.service 2021-06-30 13:25:16 +02:00
systemd-update-utmp.service.in units: adjust description of systemd-update-utmp.service 2021-06-30 13:25:16 +02:00
systemd-user-sessions.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-userdbd.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-userdbd.socket userdbd: also listen on a varlink socket io.systemd.DropIn 2021-05-10 14:58:39 +02:00
systemd-vconsole-setup.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
systemd-volatile-root.service.in meson: use jinja2 for unit templates 2021-05-19 10:24:43 +09:00
time-set.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
time-sync.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
timers.target units: adjust Descriptions of various units 2021-06-30 13:25:16 +02:00
tmp.mount unit: escape % 2022-02-23 06:54:54 +09:00
umount.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
usb-gadget.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
user-runtime-dir@.service.in logind: don't delay login for root even if systemd-user-sessions.service is not activated yet 2022-07-12 22:54:39 +01:00
user.slice license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
user@.service.in logind: don't delay login for root even if systemd-user-sessions.service is not activated yet 2022-07-12 22:54:39 +01:00
var-lib-machines.mount license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
veritysetup-pre.target dm-verity: Remove usage of integrity 2021-10-14 12:17:02 -05:00
veritysetup.target dm-verity: Remove usage of integrity 2021-10-14 12:17:02 -05:00