From: Harald Hoyer Date: Fri, 17 Jan 2014 14:27:47 +0000 (+0100) Subject: base/dracut-lib.sh: "halt" the machine in systemd mode for die() X-Git-Tag: 035~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2ecc2d8c6192453f19485bc0480c9b459081384;p=thirdparty%2Fdracut.git base/dracut-lib.sh: "halt" the machine in systemd mode for die() and only go in emergency shell if "rd.debug" is specified https://bugzilla.redhat.com/show_bug.cgi?id=1053655 --- diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index 85f7cdf42..878bb63a9 100755 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -437,8 +437,15 @@ die() { echo "warn dracut: Refusing to continue"; } >> $hookdir/emergency/01-die.sh [ -d /run/initramfs ] || mkdir -p -- /run/initramfs + > /run/initramfs/.die - emergency_shell + + getargbool 0 "rd.debug=" && emergency_shell + + if [ -n "$DRACUT_SYSTEMD" ]; then + systemctl --no-block --force halt + fi + exit 1 } @@ -1052,7 +1059,13 @@ emergency_shell() # cause a kernel panic exit 1 fi - [ -e /run/initramfs/.die ] && exit 1 + + if [ -e /run/initramfs/.die ]; then + if [ -n "$DRACUT_SYSTEMD" ]; then + systemctl --no-block --force halt + fi + exit 1 + fi } action_on_fail()