Browse Source

systemd: improve the emergency shell

master
Harald Hoyer 13 years ago
parent
commit
a6c718ce8e
  1. 2
      modules.d/98systemd/emergency.service
  2. 6
      modules.d/99base/dracut-lib.sh

2
modules.d/98systemd/emergency.service

@ -18,7 +18,7 @@ ExecStartPre=-/bin/plymouth quit @@ -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

6
modules.d/99base/dracut-lib.sh

@ -877,9 +877,7 @@ _emergency_shell() @@ -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() @@ -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
}


Loading…
Cancel
Save