Blob Blame History Raw
From 017c16b97a384915467583cc07c3afb9a98fc259 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
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 9993671c..3d489a4e 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 f888bf46..7f0835b4 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 5a6d5250..5c014110 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 1b9e701b..6340dd4d 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 20c633d0..2e1e47b9 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 d7be48d8..ed67f9df 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 f4539006..1faeb78b 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 69b4cceb..f1980368 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 d125b375..7fb33044 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 5f1eaa23..5c2c1c70 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 647315f0..64b83a0e 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 \
         \