Welcome to little lamb

Code » anopa » commit 5f7dacd

stage4: Open a shell if aa-terminate fails

author Olivier Brunel
2016-10-30 18:57:09 UTC
committer Olivier Brunel
2017-06-18 11:52:12 UTC
parent 592a62dc5a6c27ed3f8bd316cace73598620e220

stage4: Open a shell if aa-terminate fails

src/scripts/aa-stage4 +8 -1

diff --git a/src/scripts/aa-stage4 b/src/scripts/aa-stage4
index 0c5aa0d..e9060a6 100755
--- a/src/scripts/aa-stage4
+++ b/src/scripts/aa-stage4
@@ -34,5 +34,12 @@ foreground { emptyenv -c aa-stop -r /services -a }
 foreground { aa-echo -B "Mounting /dev & /proc and terminating..." }
 foreground { aa-mount -t devtmpfs dev /dev }
 foreground { aa-mount -t proc proc /proc }
-foreground { aa-terminate -la }
+foreground { if -n { aa-terminate -la }
+    foreground { aa-echo -Be "Failed to terminate (umount/close all)" }
+    foreground { aa-echo -t "Mounting /dev & /proc and trying to open a shell; " +g exit +w " to ${1}" }
+    foreground { aa-mount -t devtmpfs dev /dev }
+    foreground { aa-mount -t proc proc /proc }
+    redirfd -r 0 /dev/console redirfd -w 1 /dev/console fdmove -c 2 1
+    emptyenv -c sh -i
+}
 aa-reboot --${1}