Currently, pressing Ctrl-C during the installation - mostly relevant
when running the auto-installer - will cause a kernel panic, as
unconfigured.sh is running as PID 1.

Instead, drop the user into our debug shell, which is a bit better UX
and more useful, too.

Signed-off-by: Christoph Heiss <[email protected]>
---
 unconfigured.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/unconfigured.sh b/unconfigured.sh
index caa08c3..40e17b0 100755
--- a/unconfigured.sh
+++ b/unconfigured.sh
@@ -3,6 +3,7 @@
 reboot_action="reboot"
 
 trap "err_reboot" ERR
+trap "err_reboot" INT
 
 # NOTE: we nowadays get exec'd by the initrd's PID 1, so we're the new PID 1
 
@@ -75,6 +76,9 @@ eject_and_reboot() {
 real_reboot() {
     trap - ERR
 
+    # ignore ^C from this point, we are already shutting down
+    trap '' INT
+
     if [[ -x /etc/init.d/networking ]]; then
         /etc/init.d/networking stop
     fi
-- 
2.51.2



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to