base/dracut-lib.sh: for systemd start emergency.service
do not spawn the shell, start the emergency.service for systemdmaster
parent
d9087a2d85
commit
1e570bf8e3
|
|
@ -825,11 +825,21 @@ emergency_shell()
|
||||||
_rdshell_name=$2; action="Shutdown"; hook="shutdown-emergency"
|
_rdshell_name=$2; action="Shutdown"; hook="shutdown-emergency"
|
||||||
shift 2
|
shift 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ; echo
|
echo ; echo
|
||||||
warn $@
|
warn $@
|
||||||
source_hook "$hook"
|
source_hook "$hook"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if getargbool 1 rd.shell -y rdshell || getarg rd.break rdbreak; then
|
if getargbool 1 rd.shell -y rdshell || getarg rd.break rdbreak; then
|
||||||
|
if [ -x /lib/systemd/systemd ]; then
|
||||||
|
> /.console_lock
|
||||||
|
echo "PS1=\"$_rdshell_name:\${PWD}# \"" >/etc/profile
|
||||||
|
systemctl start emergency.service
|
||||||
|
debug_off
|
||||||
|
while [ -e /.console_lock ]; do sleep 1; done
|
||||||
|
debug_on
|
||||||
|
else
|
||||||
echo "Dropping to debug shell."
|
echo "Dropping to debug shell."
|
||||||
echo
|
echo
|
||||||
export PS1="$_rdshell_name:\${PWD}# "
|
export PS1="$_rdshell_name:\${PWD}# "
|
||||||
|
|
@ -849,6 +859,7 @@ emergency_shell()
|
||||||
# stop watchdog
|
# stop watchdog
|
||||||
echo 'V' > /dev/watchdog
|
echo 'V' > /dev/watchdog
|
||||||
setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
|
setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
warn "$action has failed. To debug this issue add \"rd.shell\" to the kernel command line."
|
warn "$action has failed. To debug this issue add \"rd.shell\" to the kernel command line."
|
||||||
# cause a kernel panic
|
# cause a kernel panic
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue