]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: Add missing dependencies on initrd-switch-root.target
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 7 May 2023 09:15:27 +0000 (11:15 +0200)
committerMike Yuan <me@yhndnzj.com>
Fri, 12 May 2023 18:14:02 +0000 (02:14 +0800)
These are all services that valid to be run in the initrd, so let's
make sure they have the appropriate dependencies on
initrd-switch-root.target so that they are stopped when we're about
to switch root.

units/systemd-networkd-wait-online.service.in
units/systemd-networkd-wait-online@.service.in
units/systemd-networkd.service.in
units/systemd-oomd.service.in
units/systemd-pstore.service.in
units/systemd-resolved.service.in
units/systemd-rfkill.service.in
units/systemd-timesyncd.service.in

index 3dc5ce9265277f40210a6a1741105f656f5baff6..40a6e897d3bcc708be4bb89c5d4f2dfbf513e4ee 100644 (file)
@@ -12,10 +12,10 @@ Description=Wait for Network to be Configured
 Documentation=man:systemd-networkd-wait-online.service(8)
 ConditionCapability=CAP_NET_ADMIN
 DefaultDependencies=no
-Conflicts=shutdown.target
+Conflicts=shutdown.target initrd-switch-root.target
 BindsTo=systemd-networkd.service
 After=systemd-networkd.service
-Before=network-online.target shutdown.target
+Before=network-online.target shutdown.target initrd-switch-root.target
 
 [Service]
 Type=oneshot
index b7a1e409f4439c827dcea4725e8b052631d2dc18..83dacf70073ffe1a66f011ad600dfae25df21cb5 100644 (file)
@@ -12,10 +12,10 @@ Description=Wait for Network Interface %i to be Configured
 Documentation=man:systemd-networkd-wait-online.service(8)
 ConditionCapability=CAP_NET_ADMIN
 DefaultDependencies=no
-Conflicts=shutdown.target
+Conflicts=shutdown.target initrd-switch-root.target
 BindsTo=systemd-networkd.service
 After=systemd-networkd.service
-Before=network-online.target shutdown.target
+Before=network-online.target shutdown.target initrd-switch-root.target
 
 [Service]
 Type=oneshot
index 585bbe5e6d3f47267a64aa064e85300d6ae7fe56..9f0af57fdc6834cda36e916d54229f731b656709 100644 (file)
@@ -15,8 +15,8 @@ ConditionCapability=CAP_NET_ADMIN
 DefaultDependencies=no
 # systemd-udevd.service can be dropped once tuntap is moved to netlink
 After=systemd-networkd.socket systemd-udevd.service network-pre.target systemd-sysusers.service systemd-sysctl.service
-Before=network.target multi-user.target shutdown.target
-Conflicts=shutdown.target
+Before=network.target multi-user.target shutdown.target initrd-switch-root.target
+Conflicts=shutdown.target initrd-switch-root.target
 Wants=systemd-networkd.socket network.target
 
 [Service]
index c138f5eefaff91d86fd8b7e5ae14c8c928a6406e..f05cab3e0b133369963cebff90bdd469c2da6ba4 100644 (file)
@@ -12,8 +12,8 @@ Description=Userspace Out-Of-Memory (OOM) Killer
 Documentation=man:systemd-oomd.service(8)
 Documentation=man:org.freedesktop.oom1(5)
 DefaultDependencies=no
-Before=multi-user.target shutdown.target
-Conflicts=shutdown.target
+Before=multi-user.target shutdown.target initrd-switch-root.target
+Conflicts=shutdown.target initrd-switch-root.target
 ConditionControlGroupController=v2
 ConditionControlGroupController=memory
 ConditionPathExists=/proc/pressure/cpu
index 02ac29caa4ed156617c75eeb2316c056728320c7..78484307346e467472dcc42498197cee137cc42a 100644 (file)
@@ -13,8 +13,8 @@ Documentation=man:systemd-pstore(8)
 ConditionDirectoryNotEmpty=/sys/fs/pstore
 ConditionVirtualization=!container
 DefaultDependencies=no
-Conflicts=shutdown.target
-Before=sysinit.target shutdown.target
+Conflicts=shutdown.target initrd-switch-root.target
+Before=sysinit.target shutdown.target initrd-switch-root.target
 After=modprobe@efi_pstore.service
 Wants=modprobe@efi_pstore.service
 
index b4227ffd429298d70085bd87597ca6651e2ad54b..10ce49345e506b70f95c35544f59aa64cbb6d2fe 100644 (file)
@@ -16,8 +16,8 @@ Documentation=https://www.freedesktop.org/wiki/Software/systemd/writing-resolver
 
 DefaultDependencies=no
 After=systemd-sysusers.service
-Before=sysinit.target network.target nss-lookup.target shutdown.target
-Conflicts=shutdown.target
+Before=sysinit.target network.target nss-lookup.target shutdown.target initrd-switch-root.target
+Conflicts=shutdown.target initrd-switch-root.target
 Wants=nss-lookup.target
 
 [Service]
index 56de1a15379fb4759218959467d3041ce8d8c6d2..24f2ccce72c443b8e75b4c88641dd09c93a9bfc1 100644 (file)
@@ -12,9 +12,9 @@ Description=Load/Save RF Kill Switch Status
 Documentation=man:systemd-rfkill.service(8)
 DefaultDependencies=no
 BindsTo=sys-devices-virtual-misc-rfkill.device
-Conflicts=shutdown.target
+Conflicts=shutdown.target initrd-switch-root.target
 After=sys-devices-virtual-misc-rfkill.device
-Before=shutdown.target
+Before=shutdown.target initrd-switch-root.target
 
 [Service]
 ExecStart={{ROOTLIBEXECDIR}}/systemd-rfkill
index c60646109138951c846d6bc197d8e34c5c9937dc..b77bb0d27bb0de4b5fa3cfdc4031cf2887302427 100644 (file)
@@ -14,8 +14,8 @@ ConditionCapability=CAP_SYS_TIME
 ConditionVirtualization=!container
 DefaultDependencies=no
 After=systemd-sysusers.service
-Before=time-set.target sysinit.target shutdown.target
-Conflicts=shutdown.target
+Before=time-set.target sysinit.target shutdown.target initrd-switch-root.target
+Conflicts=shutdown.target initrd-switch-root.target
 Wants=time-set.target
 
 [Service]