From f0ad3e6b9652fe785245934ff8604cc897d3b8f4 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sun, 7 May 2023 11:15:27 +0200 Subject: units: Add missing dependencies on initrd-switch-root.target 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 | 4 ++-- units/systemd-networkd-wait-online@.service.in | 4 ++-- units/systemd-networkd.service.in | 4 ++-- units/systemd-oomd.service.in | 4 ++-- units/systemd-pstore.service.in | 4 ++-- units/systemd-resolved.service.in | 4 ++-- units/systemd-rfkill.service.in | 4 ++-- units/systemd-timesyncd.service.in | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) (limited to 'units') diff --git a/units/systemd-networkd-wait-online.service.in b/units/systemd-networkd-wait-online.service.in index 3dc5ce9265..40a6e897d3 100644 --- a/units/systemd-networkd-wait-online.service.in +++ b/units/systemd-networkd-wait-online.service.in @@ -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 diff --git a/units/systemd-networkd-wait-online@.service.in b/units/systemd-networkd-wait-online@.service.in index b7a1e409f4..83dacf7007 100644 --- a/units/systemd-networkd-wait-online@.service.in +++ b/units/systemd-networkd-wait-online@.service.in @@ -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 diff --git a/units/systemd-networkd.service.in b/units/systemd-networkd.service.in index 585bbe5e6d..9f0af57fdc 100644 --- a/units/systemd-networkd.service.in +++ b/units/systemd-networkd.service.in @@ -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] diff --git a/units/systemd-oomd.service.in b/units/systemd-oomd.service.in index c138f5eefa..f05cab3e0b 100644 --- a/units/systemd-oomd.service.in +++ b/units/systemd-oomd.service.in @@ -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 diff --git a/units/systemd-pstore.service.in b/units/systemd-pstore.service.in index 02ac29caa4..7848430734 100644 --- a/units/systemd-pstore.service.in +++ b/units/systemd-pstore.service.in @@ -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 diff --git a/units/systemd-resolved.service.in b/units/systemd-resolved.service.in index b4227ffd42..10ce49345e 100644 --- a/units/systemd-resolved.service.in +++ b/units/systemd-resolved.service.in @@ -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] diff --git a/units/systemd-rfkill.service.in b/units/systemd-rfkill.service.in index 56de1a1537..24f2ccce72 100644 --- a/units/systemd-rfkill.service.in +++ b/units/systemd-rfkill.service.in @@ -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 diff --git a/units/systemd-timesyncd.service.in b/units/systemd-timesyncd.service.in index c606461091..b77bb0d27b 100644 --- a/units/systemd-timesyncd.service.in +++ b/units/systemd-timesyncd.service.in @@ -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] -- cgit v1.2.1