|
|
a0a3b4 |
From fd8506b5da5e81736f408bc3c4c801544a38899e Mon Sep 17 00:00:00 2001
|
|
|
a0a3b4 |
From: Harald Hoyer <harald@redhat.com>
|
|
|
a0a3b4 |
Date: Thu, 30 Jun 2016 16:34:06 +0200
|
|
|
a0a3b4 |
Subject: [PATCH] systemd: let booting work after exiting emergency
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
If the user managed to mount /sysroot, let it work
|
|
|
a0a3b4 |
---
|
|
|
a0a3b4 |
modules.d/98systemd/dracut-cmdline-ask.service | 1 -
|
|
|
a0a3b4 |
modules.d/98systemd/dracut-cmdline.service | 1 -
|
|
|
a0a3b4 |
modules.d/98systemd/dracut-emergency.service | 2 --
|
|
|
a0a3b4 |
modules.d/98systemd/dracut-initqueue.service | 1 -
|
|
|
a0a3b4 |
modules.d/98systemd/dracut-mount.service | 1 -
|
|
|
a0a3b4 |
modules.d/98systemd/dracut-pre-mount.service | 1 -
|
|
|
a0a3b4 |
modules.d/98systemd/dracut-pre-pivot.service | 1 -
|
|
|
a0a3b4 |
modules.d/98systemd/dracut-pre-trigger.service | 1 -
|
|
|
a0a3b4 |
modules.d/98systemd/dracut-pre-udev.service | 1 -
|
|
|
a0a3b4 |
modules.d/98systemd/emergency.service | 7 +++----
|
|
|
a0a3b4 |
10 files changed, 3 insertions(+), 14 deletions(-)
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/dracut-cmdline-ask.service b/modules.d/98systemd/dracut-cmdline-ask.service
|
|
|
a0a3b4 |
index 3d489a4..f9dd379 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/dracut-cmdline-ask.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/dracut-cmdline-ask.service
|
|
|
a0a3b4 |
@@ -16,7 +16,6 @@ Wants=systemd-journald.socket
|
|
|
a0a3b4 |
ConditionPathExists=/etc/initrd-release
|
|
|
a0a3b4 |
ConditionKernelCommandLine=rd.cmdline=ask
|
|
|
a0a3b4 |
Conflicts=shutdown.target emergency.target
|
|
|
a0a3b4 |
-Before=shutdown.target emergency.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=DRACUT_SYSTEMD=1
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/dracut-cmdline.service b/modules.d/98systemd/dracut-cmdline.service
|
|
|
a0a3b4 |
index 7f0835b..e4797ca 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/dracut-cmdline.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/dracut-cmdline.service
|
|
|
a0a3b4 |
@@ -21,7 +21,6 @@ ConditionKernelCommandLine=|rd.break=cmdline
|
|
|
a0a3b4 |
ConditionKernelCommandLine=|resume
|
|
|
a0a3b4 |
ConditionKernelCommandLine=|noresume
|
|
|
a0a3b4 |
Conflicts=shutdown.target emergency.target
|
|
|
a0a3b4 |
-Before=shutdown.target emergency.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=DRACUT_SYSTEMD=1
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/dracut-emergency.service b/modules.d/98systemd/dracut-emergency.service
|
|
|
a0a3b4 |
index 5c01411..183f3af 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/dracut-emergency.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/dracut-emergency.service
|
|
|
a0a3b4 |
@@ -12,10 +12,8 @@ Description=Dracut Emergency Shell
|
|
|
a0a3b4 |
DefaultDependencies=no
|
|
|
a0a3b4 |
After=systemd-vconsole-setup.service
|
|
|
a0a3b4 |
Wants=systemd-vconsole-setup.service
|
|
|
a0a3b4 |
-Conflicts=emergency.service emergency.target
|
|
|
a0a3b4 |
ConditionPathExists=!/lib/dracut/no-emergency-shell
|
|
|
a0a3b4 |
Conflicts=shutdown.target emergency.target
|
|
|
a0a3b4 |
-Before=shutdown.target emergency.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=HOME=/
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
|
|
|
a0a3b4 |
index 6340dd4..46d041e 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/dracut-initqueue.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/dracut-initqueue.service
|
|
|
a0a3b4 |
@@ -24,7 +24,6 @@ ConditionPathExistsGlob=|/lib/dracut/hooks/initqueue/online/*.sh
|
|
|
a0a3b4 |
ConditionPathExistsGlob=|/lib/dracut/hooks/initqueue/timeout/*.sh
|
|
|
a0a3b4 |
ConditionKernelCommandLine=|rd.break=initqueue
|
|
|
a0a3b4 |
Conflicts=shutdown.target emergency.target
|
|
|
a0a3b4 |
-Before=shutdown.target emergency.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=DRACUT_SYSTEMD=1
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/dracut-mount.service b/modules.d/98systemd/dracut-mount.service
|
|
|
a0a3b4 |
index 2e1e47b..e8e33fb 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/dracut-mount.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/dracut-mount.service
|
|
|
a0a3b4 |
@@ -16,7 +16,6 @@ ConditionPathExists=/etc/initrd-release
|
|
|
a0a3b4 |
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/mount
|
|
|
a0a3b4 |
ConditionKernelCommandLine=|rd.break=mount
|
|
|
a0a3b4 |
Conflicts=shutdown.target emergency.target
|
|
|
a0a3b4 |
-Before=shutdown.target emergency.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=DRACUT_SYSTEMD=1
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/dracut-pre-mount.service b/modules.d/98systemd/dracut-pre-mount.service
|
|
|
a0a3b4 |
index ed67f9d..48c9b40 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/dracut-pre-mount.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/dracut-pre-mount.service
|
|
|
a0a3b4 |
@@ -18,7 +18,6 @@ ConditionPathExists=/etc/initrd-release
|
|
|
a0a3b4 |
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-mount
|
|
|
a0a3b4 |
ConditionKernelCommandLine=|rd.break=pre-mount
|
|
|
a0a3b4 |
Conflicts=shutdown.target emergency.target
|
|
|
a0a3b4 |
-Before=shutdown.target emergency.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=DRACUT_SYSTEMD=1
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
|
|
|
a0a3b4 |
index 1faeb78..ae1f155 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/dracut-pre-pivot.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/dracut-pre-pivot.service
|
|
|
a0a3b4 |
@@ -17,7 +17,6 @@ Wants=remote-fs.target
|
|
|
a0a3b4 |
After=remote-fs.target
|
|
|
a0a3b4 |
ConditionPathExists=/etc/initrd-release
|
|
|
a0a3b4 |
Conflicts=shutdown.target emergency.target
|
|
|
a0a3b4 |
-Before=shutdown.target emergency.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=DRACUT_SYSTEMD=1
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service
|
|
|
a0a3b4 |
index f198036..5657450 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/dracut-pre-trigger.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/dracut-pre-trigger.service
|
|
|
a0a3b4 |
@@ -18,7 +18,6 @@ ConditionPathExists=/etc/initrd-release
|
|
|
a0a3b4 |
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-trigger
|
|
|
a0a3b4 |
ConditionKernelCommandLine=|rd.break=pre-trigger
|
|
|
a0a3b4 |
Conflicts=shutdown.target emergency.target
|
|
|
a0a3b4 |
-Before=shutdown.target emergency.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=DRACUT_SYSTEMD=1
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
|
|
|
a0a3b4 |
index 7fb3304..a554eb7 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/dracut-pre-udev.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/dracut-pre-udev.service
|
|
|
a0a3b4 |
@@ -21,7 +21,6 @@ ConditionKernelCommandLine=|rd.driver.blacklist
|
|
|
a0a3b4 |
ConditionKernelCommandLine=|rd.driver.pre
|
|
|
a0a3b4 |
ConditionKernelCommandLine=|rd.driver.post
|
|
|
a0a3b4 |
Conflicts=shutdown.target emergency.target
|
|
|
a0a3b4 |
-Before=shutdown.target emergency.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=DRACUT_SYSTEMD=1
|
|
|
a0a3b4 |
diff --git a/modules.d/98systemd/emergency.service b/modules.d/98systemd/emergency.service
|
|
|
a0a3b4 |
index 5c2c1c7..5da3aa3 100644
|
|
|
a0a3b4 |
--- a/modules.d/98systemd/emergency.service
|
|
|
a0a3b4 |
+++ b/modules.d/98systemd/emergency.service
|
|
|
a0a3b4 |
@@ -14,21 +14,20 @@ After=systemd-vconsole-setup.service
|
|
|
a0a3b4 |
Wants=systemd-vconsole-setup.service
|
|
|
a0a3b4 |
ConditionPathExists=!/lib/dracut/no-emergency-shell
|
|
|
a0a3b4 |
Conflicts=shutdown.target
|
|
|
a0a3b4 |
-Before=shutdown.target
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
[Service]
|
|
|
a0a3b4 |
Environment=HOME=/
|
|
|
a0a3b4 |
Environment=DRACUT_SYSTEMD=1
|
|
|
a0a3b4 |
Environment=NEWROOT=/sysroot
|
|
|
a0a3b4 |
WorkingDirectory=/
|
|
|
a0a3b4 |
-ExecStart=/bin/dracut-emergency
|
|
|
a0a3b4 |
-ExecStopPost=-/usr/bin/systemctl --fail --no-block default
|
|
|
a0a3b4 |
-Type=oneshot
|
|
|
a0a3b4 |
+ExecStart=-/bin/dracut-emergency
|
|
|
a0a3b4 |
+ExecStopPost=-/usr/bin/systemctl --no-block isolate default.target
|
|
|
a0a3b4 |
StandardInput=tty-force
|
|
|
a0a3b4 |
StandardOutput=inherit
|
|
|
a0a3b4 |
StandardError=inherit
|
|
|
a0a3b4 |
KillMode=process
|
|
|
a0a3b4 |
IgnoreSIGPIPE=no
|
|
|
a0a3b4 |
+TimeoutStartSec=0
|
|
|
a0a3b4 |
|
|
|
a0a3b4 |
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
|
|
|
a0a3b4 |
# terminates cleanly.
|