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 9810e41942

> 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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-09-15 15:54:18 +02:00
parent e9dbe2abc3
commit 4e66876dfc
18 changed files with 86 additions and 51 deletions

View File

@ -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

View File

@ -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
DefaultDependencies=no
Before=sysinit.target
Conflicts=shutdown.target
ConditionPathExists=/proc/sys/fs/binfmt_misc/
ConditionPathIsReadWrite=/proc/sys/
DefaultDependencies=no
Before=sysinit.target
Conflicts=shutdown.target
[Automount]
Where=/proc/sys/fs/binfmt_misc

View File

@ -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

View File

@ -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

View File

@ -10,14 +10,17 @@
[Unit]
Description=First Boot Wizard
Documentation=man:systemd-firstboot(1)
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
Wants=first-boot-complete.target
ConditionPathIsReadWrite=/etc
ConditionFirstBoot=yes
DefaultDependencies=no
After=systemd-remount-fs.service
Before=systemd-sysusers.service systemd-vconsole-setup.service sysinit.target first-boot-complete.target
Wants=first-boot-complete.target
Conflicts=shutdown.target
Before=shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes

View File

@ -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]

View File

@ -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]

View File

@ -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

View File

@ -10,12 +10,15 @@
[Unit]
Description=Rebuild Journal Catalog
Documentation=man:systemd-journald.service(8) man:journald.conf(5)
DefaultDependencies=no
Conflicts=shutdown.target
After=local-fs.target systemd-tmpfiles-setup.service
Before=sysinit.target shutdown.target systemd-update-done.service
ConditionNeedsUpdate=/var
DefaultDependencies=no
After=local-fs.target systemd-tmpfiles-setup.service
Before=sysinit.target systemd-update-done.service
Conflicts=shutdown.target
Before=shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes

View File

@ -10,13 +10,16 @@
[Unit]
Description=Flush Journal to Persistent Storage
Documentation=man:systemd-journald.service(8) man:journald.conf(5)
DefaultDependencies=no
Wants=systemd-journald.service
After=systemd-journald.service systemd-remount-fs.service
Before=systemd-tmpfiles-setup.service
RequiresMountsFor=/var/log/journal
ConditionPathExists=!/etc/initrd-release
DefaultDependencies=no
After=systemd-remount-fs.service
Before=systemd-tmpfiles-setup.service
Wants=systemd-journald.service
After=systemd-journald.service
RequiresMountsFor=/var/log/journal
[Service]
ExecStart=journalctl --flush
ExecStop=journalctl --smart-relinquish-var

View File

@ -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

View File

@ -11,16 +11,17 @@
Description=Load/Save OS Random Seed
Documentation=man:systemd-random-seed.service(8) man:random(4)
DefaultDependencies=no
RequiresMountsFor={{RANDOM_SEED}}
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=first-boot-complete.target shutdown.target
Wants=first-boot-complete.target
ConditionVirtualization=!container
ConditionPathExists=!/etc/initrd-release
DefaultDependencies=no
After=systemd-remount-fs.service
Before=first-boot-complete.target
RequiresMountsFor={{RANDOM_SEED}}
Wants=first-boot-complete.target
Conflicts=shutdown.target
Before=shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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