]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
base/dracut-lib.sh: "halt" the machine in systemd mode for die()
authorHarald Hoyer <harald@redhat.com>
Fri, 17 Jan 2014 14:27:47 +0000 (15:27 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 22 Jan 2014 10:18:47 +0000 (11:18 +0100)
and only go in emergency shell if "rd.debug" is specified

https://bugzilla.redhat.com/show_bug.cgi?id=1053655

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

index 85f7cdf42a0f6abc9de22231edf3524370248170..878bb63a93f3d15d1e80ecc1775b293100d1ac2f 100755 (executable)
@@ -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()