]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
systemd: improve the emergency shell
authorHarald Hoyer <harald@redhat.com>
Wed, 3 Oct 2012 20:38:38 +0000 (16:38 -0400)
committerHarald Hoyer <harald@redhat.com>
Wed, 3 Oct 2012 20:39:27 +0000 (16:39 -0400)
modules.d/98systemd/emergency.service
modules.d/99base/dracut-lib.sh

index 431e2b019f449fc18509d592d05f3f0a7d4077a6..4ec7861278cad9ce809cf7bccdb191b75c5dac3f 100644 (file)
@@ -18,7 +18,7 @@ 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=-/bin/rm -f /.console_lock
-Type=idle
+Type=oneshot
 StandardInput=tty-force
 StandardOutput=inherit
 StandardError=inherit
index 294f29befe78a81684e152f6403a5af40b8eba7e..7c1c31b4bfc5920b6e10ad6f132fef558589421c 100755 (executable)
@@ -877,9 +877,7 @@ _emergency_shell()
         > /.console_lock
         echo "PS1=\"$_name:\${PWD}# \"" >/etc/profile
         systemctl start emergency.service
-        debug_off
-        while [ -e /.console_lock ]; do sleep 1; done
-        debug_on
+        rm -f /.console_lock
     else
         echo "Dropping to debug shell."
         echo
@@ -897,7 +895,7 @@ _emergency_shell()
         fi
         [ -c "$_ctty" ] || _ctty=/dev/tty1
         case "$(/usr/bin/setsid --help 2>&1)" in *--ctty*) CTTY="--ctty";; esac
-        setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
+        setsid $CTTY /bin/sh -i -l 0<>$_ctty 1<>$_ctty 2<>$_ctty
     fi
 }