Blame 0044-systemd-fix-emergency.service-and-rescue.service.patch

Harald Hoyer e3ef57
From b47e023767ae6c8dad816d44b3ffd8dcd5048afe Mon Sep 17 00:00:00 2001
Harald Hoyer e3ef57
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer e3ef57
Date: Thu, 21 Jun 2012 01:01:51 +0200
Harald Hoyer e3ef57
Subject: [PATCH] systemd: fix emergency.service and rescue.service
Harald Hoyer e3ef57
Harald Hoyer e3ef57
---
Harald Hoyer e3ef57
 modules.d/98systemd/emergency.service |   10 +++++-----
Harald Hoyer e3ef57
 modules.d/98systemd/module-setup.sh   |    2 +-
Harald Hoyer e3ef57
 modules.d/98systemd/rescue.service    |   11 +++++------
Harald Hoyer e3ef57
 3 files changed, 11 insertions(+), 12 deletions(-)
Harald Hoyer e3ef57
Harald Hoyer e3ef57
diff --git a/modules.d/98systemd/emergency.service b/modules.d/98systemd/emergency.service
Harald Hoyer e3ef57
index 86fc13f..431e2b0 100644
Harald Hoyer e3ef57
--- a/modules.d/98systemd/emergency.service
Harald Hoyer e3ef57
+++ b/modules.d/98systemd/emergency.service
Harald Hoyer e3ef57
@@ -10,17 +10,17 @@
Harald Hoyer e3ef57
 [Unit]
Harald Hoyer e3ef57
 Description=Emergency Shell
Harald Hoyer e3ef57
 DefaultDependencies=no
Harald Hoyer e3ef57
-Conflicts=shutdown.target
Harald Hoyer e3ef57
-Before=shutdown.target
Harald Hoyer e3ef57
 
Harald Hoyer e3ef57
 [Service]
Harald Hoyer e3ef57
 Environment=HOME=/
Harald Hoyer e3ef57
 WorkingDirectory=/
Harald Hoyer e3ef57
+ExecStartPre=-/bin/plymouth quit
Harald Hoyer e3ef57
+ExecStartPre=-/bin/echo -e '\n\nEntering emergency mode. Exit the shell to continue.\nType "journalctl" to view system logs.\n'
Harald Hoyer e3ef57
 ExecStart=-/bin/sh -i -l
Harald Hoyer e3ef57
-ExecStopPost=-/usr/bin/systemctl --fail --no-block default
Harald Hoyer e3ef57
+ExecStopPost=-/bin/rm -f /.console_lock
Harald Hoyer e3ef57
 Type=idle
Harald Hoyer e3ef57
-StandardInput=tty
Harald Hoyer e3ef57
-StandardOutput=journal+console
Harald Hoyer e3ef57
+StandardInput=tty-force
Harald Hoyer e3ef57
+StandardOutput=inherit
Harald Hoyer e3ef57
 StandardError=inherit
Harald Hoyer e3ef57
 KillMode=process
Harald Hoyer e3ef57
 IgnoreSIGPIPE=no
Harald Hoyer e3ef57
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
Harald Hoyer e3ef57
index 2160eb4..91f50af 100755
Harald Hoyer e3ef57
--- a/modules.d/98systemd/module-setup.sh
Harald Hoyer e3ef57
+++ b/modules.d/98systemd/module-setup.sh
Harald Hoyer e3ef57
@@ -116,7 +116,7 @@ install() {
Harald Hoyer e3ef57
         dracut_install "$i"
Harald Hoyer e3ef57
     done
Harald Hoyer e3ef57
 
Harald Hoyer e3ef57
-    dracut_install journalctl systemctl
Harald Hoyer e3ef57
+    dracut_install journalctl systemctl echo
Harald Hoyer e3ef57
 
Harald Hoyer e3ef57
     ln -fs $systemdutildir/systemd "$initdir/init"
Harald Hoyer e3ef57
 
Harald Hoyer e3ef57
diff --git a/modules.d/98systemd/rescue.service b/modules.d/98systemd/rescue.service
Harald Hoyer e3ef57
index afd04f7..b5fb663 100644
Harald Hoyer e3ef57
--- a/modules.d/98systemd/rescue.service
Harald Hoyer e3ef57
+++ b/modules.d/98systemd/rescue.service
Harald Hoyer e3ef57
@@ -10,21 +10,20 @@
Harald Hoyer e3ef57
 [Unit]
Harald Hoyer e3ef57
 Description=Rescue Shell
Harald Hoyer e3ef57
 DefaultDependencies=no
Harald Hoyer e3ef57
-Conflicts=shutdown.target
Harald Hoyer e3ef57
-After=basic.target plymouth-start.service
Harald Hoyer e3ef57
-Before=shutdown.target
Harald Hoyer e3ef57
 
Harald Hoyer e3ef57
 [Service]
Harald Hoyer e3ef57
 Environment=HOME=/
Harald Hoyer e3ef57
 WorkingDirectory=/
Harald Hoyer e3ef57
+ExecStartPre=-/bin/plymouth quit
Harald Hoyer e3ef57
 ExecStart=-/bin/sh -i -l
Harald Hoyer e3ef57
-#ExecStopPost=-/usr/bin/systemctl --fail --no-block switch-root /sysroot /sbin/init
Harald Hoyer e3ef57
+ExecStopPost=-/bin/rm -f /.console_lock
Harald Hoyer e3ef57
 ExecStopPost=-/usr/bin/systemctl --fail --no-block default
Harald Hoyer e3ef57
 Type=idle
Harald Hoyer e3ef57
-StandardInput=tty
Harald Hoyer e3ef57
-StandardOutput=journal+console
Harald Hoyer e3ef57
+StandardInput=tty-force
Harald Hoyer e3ef57
+StandardOutput=inherit
Harald Hoyer e3ef57
 StandardError=inherit
Harald Hoyer e3ef57
 KillMode=process
Harald Hoyer e3ef57
+IgnoreSIGPIPE=no
Harald Hoyer e3ef57
 
Harald Hoyer e3ef57
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
Harald Hoyer e3ef57
 # terminates cleanly.