dracut/0044-systemd-fix-emergency.service-and-rescue.service.patch
Harald Hoyer e3ef5716a9 dracut-019-57.git20120620
systemd is now the default init in the initramfs
2012-06-21 02:10:56 +02:00

83 lines
2.6 KiB
Diff

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