From 017c16b97a384915467583cc07c3afb9a98fc259 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 27 Jun 2016 10:27:05 +0200 Subject: [PATCH] systemd: add -.slice and make reboot work -.slice and conflicting with emergency.target and shutdown.target makes reboot work --- modules.d/98systemd/dracut-cmdline-ask.service | 2 ++ modules.d/98systemd/dracut-cmdline.service | 2 ++ modules.d/98systemd/dracut-emergency.service | 2 ++ modules.d/98systemd/dracut-initqueue.service | 2 ++ modules.d/98systemd/dracut-mount.service | 2 ++ modules.d/98systemd/dracut-pre-mount.service | 2 ++ modules.d/98systemd/dracut-pre-pivot.service | 2 ++ modules.d/98systemd/dracut-pre-trigger.service | 2 ++ modules.d/98systemd/dracut-pre-udev.service | 2 ++ modules.d/98systemd/emergency.service | 2 ++ modules.d/98systemd/module-setup.sh | 1 + 11 files changed, 21 insertions(+) diff --git a/modules.d/98systemd/dracut-cmdline-ask.service b/modules.d/98systemd/dracut-cmdline-ask.service index 9993671..3d489a4 100644 --- a/modules.d/98systemd/dracut-cmdline-ask.service +++ b/modules.d/98systemd/dracut-cmdline-ask.service @@ -15,6 +15,8 @@ After=systemd-journald.socket Wants=systemd-journald.socket ConditionPathExists=/etc/initrd-release ConditionKernelCommandLine=rd.cmdline=ask +Conflicts=shutdown.target emergency.target +Before=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 diff --git a/modules.d/98systemd/dracut-cmdline.service b/modules.d/98systemd/dracut-cmdline.service index f888bf4..7f0835b 100644 --- a/modules.d/98systemd/dracut-cmdline.service +++ b/modules.d/98systemd/dracut-cmdline.service @@ -20,6 +20,8 @@ ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cmdline ConditionKernelCommandLine=|rd.break=cmdline ConditionKernelCommandLine=|resume ConditionKernelCommandLine=|noresume +Conflicts=shutdown.target emergency.target +Before=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 diff --git a/modules.d/98systemd/dracut-emergency.service b/modules.d/98systemd/dracut-emergency.service index 5a6d525..5c01411 100644 --- a/modules.d/98systemd/dracut-emergency.service +++ b/modules.d/98systemd/dracut-emergency.service @@ -14,6 +14,8 @@ After=systemd-vconsole-setup.service Wants=systemd-vconsole-setup.service Conflicts=emergency.service emergency.target ConditionPathExists=!/lib/dracut/no-emergency-shell +Conflicts=shutdown.target emergency.target +Before=shutdown.target emergency.target [Service] Environment=HOME=/ diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service index 1b9e701..6340dd4 100644 --- a/modules.d/98systemd/dracut-initqueue.service +++ b/modules.d/98systemd/dracut-initqueue.service @@ -23,6 +23,8 @@ ConditionPathExistsGlob=|/lib/dracut/hooks/initqueue/finished/*.sh ConditionPathExistsGlob=|/lib/dracut/hooks/initqueue/online/*.sh ConditionPathExistsGlob=|/lib/dracut/hooks/initqueue/timeout/*.sh ConditionKernelCommandLine=|rd.break=initqueue +Conflicts=shutdown.target emergency.target +Before=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 diff --git a/modules.d/98systemd/dracut-mount.service b/modules.d/98systemd/dracut-mount.service index 20c633d..2e1e47b 100644 --- a/modules.d/98systemd/dracut-mount.service +++ b/modules.d/98systemd/dracut-mount.service @@ -15,6 +15,8 @@ After=dracut-initqueue.service dracut-pre-mount.service ConditionPathExists=/etc/initrd-release ConditionDirectoryNotEmpty=|/lib/dracut/hooks/mount ConditionKernelCommandLine=|rd.break=mount +Conflicts=shutdown.target emergency.target +Before=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 diff --git a/modules.d/98systemd/dracut-pre-mount.service b/modules.d/98systemd/dracut-pre-mount.service index d7be48d..ed67f9d 100644 --- a/modules.d/98systemd/dracut-pre-mount.service +++ b/modules.d/98systemd/dracut-pre-mount.service @@ -17,6 +17,8 @@ After=cryptsetup.target ConditionPathExists=/etc/initrd-release ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-mount ConditionKernelCommandLine=|rd.break=pre-mount +Conflicts=shutdown.target emergency.target +Before=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service index f453900..1faeb78 100644 --- a/modules.d/98systemd/dracut-pre-pivot.service +++ b/modules.d/98systemd/dracut-pre-pivot.service @@ -16,6 +16,8 @@ Before=initrd-cleanup.service Wants=remote-fs.target After=remote-fs.target ConditionPathExists=/etc/initrd-release +Conflicts=shutdown.target emergency.target +Before=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service index 69b4cce..f198036 100644 --- a/modules.d/98systemd/dracut-pre-trigger.service +++ b/modules.d/98systemd/dracut-pre-trigger.service @@ -17,6 +17,8 @@ Wants=dracut-pre-udev.service systemd-udevd.service ConditionPathExists=/etc/initrd-release ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-trigger ConditionKernelCommandLine=|rd.break=pre-trigger +Conflicts=shutdown.target emergency.target +Before=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service index d125b37..7fb3304 100644 --- a/modules.d/98systemd/dracut-pre-udev.service +++ b/modules.d/98systemd/dracut-pre-udev.service @@ -20,6 +20,8 @@ ConditionKernelCommandLine=|rd.break=pre-udev ConditionKernelCommandLine=|rd.driver.blacklist ConditionKernelCommandLine=|rd.driver.pre ConditionKernelCommandLine=|rd.driver.post +Conflicts=shutdown.target emergency.target +Before=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 diff --git a/modules.d/98systemd/emergency.service b/modules.d/98systemd/emergency.service index 5f1eaa2..5c2c1c7 100644 --- a/modules.d/98systemd/emergency.service +++ b/modules.d/98systemd/emergency.service @@ -13,6 +13,8 @@ DefaultDependencies=no After=systemd-vconsole-setup.service Wants=systemd-vconsole-setup.service ConditionPathExists=!/lib/dracut/no-emergency-shell +Conflicts=shutdown.target +Before=shutdown.target [Service] Environment=HOME=/ diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh index 647315f..64b83a0 100755 --- a/modules.d/98systemd/module-setup.sh +++ b/modules.d/98systemd/module-setup.sh @@ -137,6 +137,7 @@ install() { \ $systemdsystemunitdir/slices.target \ $systemdsystemunitdir/system.slice \ + $systemdsystemunitdir/-.slice \ \ $tmpfilesdir/systemd.conf \ \