]> git.ozlabs.org Git - petitboot/blobdiff - utils/pb-console
utils/pb-console: Trap SIGTERM on boot
[petitboot] / utils / pb-console
index ef9ed0f61d455a8fc85757611d0dab374fa8e90c..5ba98cc4692564b435d1f7d271bf07355e838c06 100644 (file)
@@ -94,7 +94,7 @@ then
 
        if [ "$detach" = 1 ]
        then
 
        if [ "$detach" = 1 ]
        then
-               $getty $login_arg "$@" &
+               setsid -c $getty $login_arg "$@" &
                exit
        else
                exec $getty $login_arg "$@"
                exit
        else
                exec $getty $login_arg "$@"
@@ -134,11 +134,12 @@ fi
 # show particularly important messages
 dmesg -n 1
 
 # show particularly important messages
 dmesg -n 1
 
+trap '' SIGINT
+trap 'reset; echo "SIGTERM received, booting..."; sleep 2' SIGTERM
+
 while :
 do
        $ui $verbose_opt
        reset
 while :
 do
        $ui $verbose_opt
        reset
-       echo "Exiting petitboot. Type 'exit' to return."
-       echo "You may run 'pb-sos' to gather diagnostic data"
        $shell
 done
        $shell
 done