diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-09-15 15:54:18 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-05-23 12:39:16 +0200 |
commit | 4e66876dfc9ab1b9b7063988d7f3689568c76cfe (patch) | |
tree | 4e2d33bf9e46a956bc5635f140aacdec5592d2b2 | |
parent | update TODO (diff) | |
download | systemd-4e66876dfc9ab1b9b7063988d7f3689568c76cfe.tar.xz systemd-4e66876dfc9ab1b9b7063988d7f3689568c76cfe.zip |
units: do more reordering of ordering config
No functional change, just a cleanup to make the subsequent changes easier to
see. This is a continuation of 9810e419425263bde86787bc21251f1ad3c35628
> The block is reordered and split to have:
> 1. description + documentation
> 2. (optionally) conditions
> 3. all the dependencies
The dependencies for shutdown.target are listed separately because they are the
other deps are for startup, and shutdown.target only matter much later.
-rw-r--r-- | units/local-fs.target | 3 | ||||
-rw-r--r-- | units/proc-sys-fs-binfmt_misc.automount | 6 | ||||
-rw-r--r-- | units/quotaon.service.in | 7 | ||||
-rw-r--r-- | units/systemd-boot-update.service | 3 | ||||
-rw-r--r-- | units/systemd-firstboot.service | 11 | ||||
-rw-r--r-- | units/systemd-growfs-root.service.in | 3 | ||||
-rw-r--r-- | units/systemd-growfs@.service.in | 3 | ||||
-rw-r--r-- | units/systemd-hwdb-update.service.in | 11 | ||||
-rw-r--r-- | units/systemd-journal-catalog-update.service | 9 | ||||
-rw-r--r-- | units/systemd-journal-flush.service | 9 | ||||
-rw-r--r-- | units/systemd-quotacheck.service.in | 7 | ||||
-rw-r--r-- | units/systemd-random-seed.service.in | 13 | ||||
-rw-r--r-- | units/systemd-remount-fs.service.in | 6 | ||||
-rw-r--r-- | units/systemd-repart.service.in | 13 | ||||
-rw-r--r-- | units/systemd-rfkill.socket | 3 | ||||
-rw-r--r-- | units/systemd-sysusers.service | 6 | ||||
-rw-r--r-- | units/systemd-update-utmp.service.in | 8 | ||||
-rw-r--r-- | units/systemd-vconsole-setup.service.in | 4 |
18 files changed, 80 insertions, 45 deletions
diff --git a/units/local-fs.target b/units/local-fs.target index 02797953a5..fe175a7af9 100644 --- a/units/local-fs.target +++ b/units/local-fs.target @@ -10,8 +10,9 @@ [Unit] Description=Local File Systems Documentation=man:systemd.special(7) + DefaultDependencies=no -Conflicts=shutdown.target After=local-fs-pre.target +Conflicts=shutdown.target OnFailure=emergency.target OnFailureJobMode=replace-irreversibly diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount index 6b1bbdc91e..41396f9299 100644 --- a/units/proc-sys-fs-binfmt_misc.automount +++ b/units/proc-sys-fs-binfmt_misc.automount @@ -11,11 +11,13 @@ Description=Arbitrary Executable File Formats File System Automount Point Documentation=https://docs.kernel.org/admin-guide/binfmt-misc.html Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems + +ConditionPathExists=/proc/sys/fs/binfmt_misc/ +ConditionPathIsReadWrite=/proc/sys/ + DefaultDependencies=no Before=sysinit.target Conflicts=shutdown.target -ConditionPathExists=/proc/sys/fs/binfmt_misc/ -ConditionPathIsReadWrite=/proc/sys/ [Automount] Where=/proc/sys/fs/binfmt_misc diff --git a/units/quotaon.service.in b/units/quotaon.service.in index ffabebfafe..7fa7061eea 100644 --- a/units/quotaon.service.in +++ b/units/quotaon.service.in @@ -10,10 +10,13 @@ [Unit] Description=Enable File System Quotas Documentation=man:quotaon(8) + +ConditionPathExists={{QUOTAON}} + DefaultDependencies=no After=systemd-quotacheck.service -Before=remote-fs.target shutdown.target -ConditionPathExists={{QUOTAON}} +Before=remote-fs.target +Before=shutdown.target [Service] Type=oneshot diff --git a/units/systemd-boot-update.service b/units/systemd-boot-update.service index fe63fde35a..ce9187bbfe 100644 --- a/units/systemd-boot-update.service +++ b/units/systemd-boot-update.service @@ -13,8 +13,9 @@ Documentation=man:bootctl(1) DefaultDependencies=no After=local-fs.target +Before=sysinit.target systemd-update-done.service Conflicts=shutdown.target -Before=sysinit.target shutdown.target systemd-update-done.service +Before=shutdown.target [Service] Type=oneshot diff --git a/units/systemd-firstboot.service b/units/systemd-firstboot.service index 2e57b064c1..58f3eeb679 100644 --- a/units/systemd-firstboot.service +++ b/units/systemd-firstboot.service @@ -10,13 +10,16 @@ [Unit] Description=First Boot Wizard Documentation=man:systemd-firstboot(1) + +ConditionPathIsReadWrite=/etc +ConditionFirstBoot=yes + DefaultDependencies=no -Conflicts=shutdown.target After=systemd-remount-fs.service -Before=systemd-sysusers.service systemd-vconsole-setup.service sysinit.target first-boot-complete.target shutdown.target +Before=systemd-sysusers.service systemd-vconsole-setup.service sysinit.target first-boot-complete.target Wants=first-boot-complete.target -ConditionPathIsReadWrite=/etc -ConditionFirstBoot=yes +Conflicts=shutdown.target +Before=shutdown.target [Service] Type=oneshot diff --git a/units/systemd-growfs-root.service.in b/units/systemd-growfs-root.service.in index 295bafd5af..61b825672d 100644 --- a/units/systemd-growfs-root.service.in +++ b/units/systemd-growfs-root.service.in @@ -10,9 +10,10 @@ [Unit] Description=Grow Root File System Documentation=man:systemd-growfs-root.service(8) + DefaultDependencies=no -Conflicts=shutdown.target After=systemd-repart.service systemd-remount-fs.service +Conflicts=shutdown.target Before=shutdown.target [Service] diff --git a/units/systemd-growfs@.service.in b/units/systemd-growfs@.service.in index 7154e4ca76..d7c90e96fc 100644 --- a/units/systemd-growfs@.service.in +++ b/units/systemd-growfs@.service.in @@ -10,10 +10,11 @@ [Unit] Description=Grow File System on %f Documentation=man:systemd-growfs@.service(8) + DefaultDependencies=no BindsTo=%i.mount -Conflicts=shutdown.target After=systemd-repart.service %i.mount +Conflicts=shutdown.target Before=shutdown.target [Service] diff --git a/units/systemd-hwdb-update.service.in b/units/systemd-hwdb-update.service.in index a09fe8aa52..4ba36d1fc6 100644 --- a/units/systemd-hwdb-update.service.in +++ b/units/systemd-hwdb-update.service.in @@ -10,15 +10,18 @@ [Unit] Description=Rebuild Hardware Database Documentation=man:hwdb(7) man:systemd-hwdb(8) -DefaultDependencies=no -Conflicts=shutdown.target -After=systemd-remount-fs.service -Before=sysinit.target shutdown.target systemd-update-done.service + ConditionNeedsUpdate=/etc ConditionPathExists=|!{{UDEVLIBEXECDIR}}/hwdb.bin ConditionPathExists=|/etc/udev/hwdb.bin ConditionDirectoryNotEmpty=|/etc/udev/hwdb.d/ +DefaultDependencies=no +After=systemd-remount-fs.service +Before=sysinit.target systemd-update-done.service +Conflicts=shutdown.target +Before=shutdown.target + [Service] Type=oneshot RemainAfterExit=yes diff --git a/units/systemd-journal-catalog-update.service b/units/systemd-journal-catalog-update.service index 477925685a..691e03fe62 100644 --- a/units/systemd-journal-catalog-update.service +++ b/units/systemd-journal-catalog-update.service @@ -10,11 +10,14 @@ [Unit] Description=Rebuild Journal Catalog Documentation=man:systemd-journald.service(8) man:journald.conf(5) + +ConditionNeedsUpdate=/var + DefaultDependencies=no -Conflicts=shutdown.target After=local-fs.target systemd-tmpfiles-setup.service -Before=sysinit.target shutdown.target systemd-update-done.service -ConditionNeedsUpdate=/var +Before=sysinit.target systemd-update-done.service +Conflicts=shutdown.target +Before=shutdown.target [Service] Type=oneshot diff --git a/units/systemd-journal-flush.service b/units/systemd-journal-flush.service index 5d0b811ae3..8c01587cad 100644 --- a/units/systemd-journal-flush.service +++ b/units/systemd-journal-flush.service @@ -10,12 +10,15 @@ [Unit] Description=Flush Journal to Persistent Storage Documentation=man:systemd-journald.service(8) man:journald.conf(5) + +ConditionPathExists=!/etc/initrd-release + DefaultDependencies=no -Wants=systemd-journald.service -After=systemd-journald.service systemd-remount-fs.service +After=systemd-remount-fs.service Before=systemd-tmpfiles-setup.service +Wants=systemd-journald.service +After=systemd-journald.service RequiresMountsFor=/var/log/journal -ConditionPathExists=!/etc/initrd-release [Service] ExecStart=journalctl --flush diff --git a/units/systemd-quotacheck.service.in b/units/systemd-quotacheck.service.in index c3e936d220..05c14ff8b6 100644 --- a/units/systemd-quotacheck.service.in +++ b/units/systemd-quotacheck.service.in @@ -10,10 +10,13 @@ [Unit] Description=File System Quota Check Documentation=man:systemd-quotacheck.service(8) + +ConditionPathExists={{QUOTACHECK}} + DefaultDependencies=no After=systemd-remount-fs.service -Before=remote-fs.target shutdown.target -ConditionPathExists={{QUOTACHECK}} +Before=remote-fs.target +Before=shutdown.target [Service] Type=oneshot diff --git a/units/systemd-random-seed.service.in b/units/systemd-random-seed.service.in index d57b2d1269..820fdd8536 100644 --- a/units/systemd-random-seed.service.in +++ b/units/systemd-random-seed.service.in @@ -11,15 +11,16 @@ Description=Load/Save OS Random Seed Documentation=man:systemd-random-seed.service(8) man:random(4) +ConditionVirtualization=!container +ConditionPathExists=!/etc/initrd-release + DefaultDependencies=no -RequiresMountsFor={{RANDOM_SEED}} -Conflicts=shutdown.target After=systemd-remount-fs.service -Before=first-boot-complete.target shutdown.target +Before=first-boot-complete.target +RequiresMountsFor={{RANDOM_SEED}} Wants=first-boot-complete.target - -ConditionVirtualization=!container -ConditionPathExists=!/etc/initrd-release +Conflicts=shutdown.target +Before=shutdown.target [Service] Type=oneshot diff --git a/units/systemd-remount-fs.service.in b/units/systemd-remount-fs.service.in index 2abed1d0a9..be1dfd6199 100644 --- a/units/systemd-remount-fs.service.in +++ b/units/systemd-remount-fs.service.in @@ -11,11 +11,13 @@ Description=Remount Root and Kernel File Systems Documentation=man:systemd-remount-fs.service(8) Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems + DefaultDependencies=no -Conflicts=shutdown.target After=systemd-fsck-root.service -Before=local-fs-pre.target local-fs.target shutdown.target +Before=local-fs-pre.target local-fs.target Wants=local-fs-pre.target +Conflicts=shutdown.target +Before=shutdown.target [Service] Type=oneshot diff --git a/units/systemd-repart.service.in b/units/systemd-repart.service.in index 105be680cd..5c04a21834 100644 --- a/units/systemd-repart.service.in +++ b/units/systemd-repart.service.in @@ -10,11 +10,7 @@ [Unit] Description=Repartition Root Disk Documentation=man:systemd-repart.service(8) -DefaultDependencies=no -Conflicts=shutdown.target -Wants=modprobe@loop.service modprobe@dm_mod.service -After=initrd-usr-fs.target modprobe@loop.service modprobe@dm_mod.service -Before=initrd-root-fs.target shutdown.target + ConditionVirtualization=!container ConditionDirectoryNotEmpty=|/usr/lib/repart.d ConditionDirectoryNotEmpty=|/usr/local/lib/repart.d @@ -26,6 +22,13 @@ ConditionDirectoryNotEmpty=|/sysroot/etc/repart.d ConditionDirectoryNotEmpty=|/sysusr/usr/lib/repart.d ConditionDirectoryNotEmpty=|/sysusr/usr/local/lib/repart.d +DefaultDependencies=no +Wants=modprobe@loop.service modprobe@dm_mod.service +After=initrd-usr-fs.target modprobe@loop.service modprobe@dm_mod.service +Before=initrd-root-fs.target +Conflicts=shutdown.target +Before=shutdown.target + [Service] Type=oneshot RemainAfterExit=yes diff --git a/units/systemd-rfkill.socket b/units/systemd-rfkill.socket index 4ca8d6fc04..81c0e8c9c6 100644 --- a/units/systemd-rfkill.socket +++ b/units/systemd-rfkill.socket @@ -10,12 +10,13 @@ [Unit] Description=Load/Save RF Kill Switch Status /dev/rfkill Watch Documentation=man:systemd-rfkill.socket(8) + DefaultDependencies=no BindsTo=sys-devices-virtual-misc-rfkill.device After=sys-devices-virtual-misc-rfkill.device systemd-remount-fs.service -RequiresMountsFor=/var/lib/systemd/rfkill Conflicts=shutdown.target Before=shutdown.target +RequiresMountsFor=/var/lib/systemd/rfkill [Socket] ListenSpecial=/dev/rfkill diff --git a/units/systemd-sysusers.service b/units/systemd-sysusers.service index 0eb40294b2..2ec2766841 100644 --- a/units/systemd-sysusers.service +++ b/units/systemd-sysusers.service @@ -11,15 +11,15 @@ Description=Create System Users Documentation=man:sysusers.d(5) man:systemd-sysusers.service(8) +ConditionNeedsUpdate=|/etc +ConditionCredential=|sysusers.extra + DefaultDependencies=no After=systemd-remount-fs.service Before=sysinit.target systemd-update-done.service Conflicts=shutdown.target initrd-switch-root.target Before=shutdown.target initrd-switch-root.target -ConditionNeedsUpdate=|/etc -ConditionCredential=|sysusers.extra - [Service] Type=oneshot RemainAfterExit=yes diff --git a/units/systemd-update-utmp.service.in b/units/systemd-update-utmp.service.in index cedefa8e08..f1278fae32 100644 --- a/units/systemd-update-utmp.service.in +++ b/units/systemd-update-utmp.service.in @@ -10,11 +10,13 @@ [Unit] Description=Record System Boot/Shutdown in UTMP Documentation=man:systemd-update-utmp.service(8) man:utmp(5) + DefaultDependencies=no -RequiresMountsFor=/var/log/wtmp -Conflicts=shutdown.target After=systemd-remount-fs.service systemd-tmpfiles-setup.service auditd.service -Before=sysinit.target shutdown.target +Before=sysinit.target +Conflicts=shutdown.target +Before=shutdown.target +RequiresMountsFor=/var/log/wtmp [Service] Type=oneshot diff --git a/units/systemd-vconsole-setup.service.in b/units/systemd-vconsole-setup.service.in index 0009528307..41d738a63d 100644 --- a/units/systemd-vconsole-setup.service.in +++ b/units/systemd-vconsole-setup.service.in @@ -10,10 +10,12 @@ [Unit] Description=Setup Virtual Console Documentation=man:systemd-vconsole-setup.service(8) man:vconsole.conf(5) + +ConditionPathExists=/dev/tty0 + DefaultDependencies=no Before=sysinit.target Before=initrd-switch-root.target shutdown.target -ConditionPathExists=/dev/tty0 [Service] Type=oneshot |