You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
6.4 KiB

From fd8506b5da5e81736f408bc3c4c801544a38899e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 30 Jun 2016 16:34:06 +0200
Subject: [PATCH] systemd: let booting work after exiting emergency
If the user managed to mount /sysroot, let it work
---
modules.d/98systemd/dracut-cmdline-ask.service | 1 -
modules.d/98systemd/dracut-cmdline.service | 1 -
modules.d/98systemd/dracut-emergency.service | 2 --
modules.d/98systemd/dracut-initqueue.service | 1 -
modules.d/98systemd/dracut-mount.service | 1 -
modules.d/98systemd/dracut-pre-mount.service | 1 -
modules.d/98systemd/dracut-pre-pivot.service | 1 -
modules.d/98systemd/dracut-pre-trigger.service | 1 -
modules.d/98systemd/dracut-pre-udev.service | 1 -
modules.d/98systemd/emergency.service | 7 +++----
10 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/modules.d/98systemd/dracut-cmdline-ask.service b/modules.d/98systemd/dracut-cmdline-ask.service
index 3d489a4e..f9dd3790 100644
--- a/modules.d/98systemd/dracut-cmdline-ask.service
+++ b/modules.d/98systemd/dracut-cmdline-ask.service
@@ -16,7 +16,6 @@ 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 7f0835b4..e4797ca3 100644
--- a/modules.d/98systemd/dracut-cmdline.service
+++ b/modules.d/98systemd/dracut-cmdline.service
@@ -21,7 +21,6 @@ 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 5c014110..183f3af5 100644
--- a/modules.d/98systemd/dracut-emergency.service
+++ b/modules.d/98systemd/dracut-emergency.service
@@ -12,10 +12,8 @@ Description=Dracut Emergency Shell
DefaultDependencies=no
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 6340dd4d..46d041e8 100644
--- a/modules.d/98systemd/dracut-initqueue.service
+++ b/modules.d/98systemd/dracut-initqueue.service
@@ -24,7 +24,6 @@ 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 2e1e47b9..e8e33fbb 100644
--- a/modules.d/98systemd/dracut-mount.service
+++ b/modules.d/98systemd/dracut-mount.service
@@ -16,7 +16,6 @@ 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 ed67f9df..48c9b400 100644
--- a/modules.d/98systemd/dracut-pre-mount.service
+++ b/modules.d/98systemd/dracut-pre-mount.service
@@ -18,7 +18,6 @@ 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 1faeb78b..ae1f155d 100644
--- a/modules.d/98systemd/dracut-pre-pivot.service
+++ b/modules.d/98systemd/dracut-pre-pivot.service
@@ -17,7 +17,6 @@ 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 f1980368..5657450e 100644
--- a/modules.d/98systemd/dracut-pre-trigger.service
+++ b/modules.d/98systemd/dracut-pre-trigger.service
@@ -18,7 +18,6 @@ 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 7fb33044..a554eb79 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -21,7 +21,6 @@ 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 5c2c1c70..5da3aa31 100644
--- a/modules.d/98systemd/emergency.service
+++ b/modules.d/98systemd/emergency.service
@@ -14,21 +14,20 @@ 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=/
Environment=DRACUT_SYSTEMD=1
Environment=NEWROOT=/sysroot
WorkingDirectory=/
-ExecStart=/bin/dracut-emergency
-ExecStopPost=-/usr/bin/systemctl --fail --no-block default
-Type=oneshot
+ExecStart=-/bin/dracut-emergency
+ExecStopPost=-/usr/bin/systemctl --no-block isolate default.target
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit
KillMode=process
IgnoreSIGPIPE=no
+TimeoutStartSec=0
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.