Skip to content

Commit 5c726bd

Browse files
committed
utils/pb-console: Trap SIGTERM on boot
On kexec all processes will be sent a SIGTERM and SIGKILL. By default there are messages on the console alerting the user to this, however in some implementations these messages are disabled. This can have the effect of the UI seemingly exiting to the shell on boot and hanging for a short while before the kexec actually jumps into the next kernel. Trap the SIGTERM sent to the pb-console parent process and print a short message to the screen instead of momentarily dropping to the shell and printing the usual help messages. While here also cleanup the shell help messages below which are now handled in the shell's .shrc file. Signed-off-by: Samuel Mendoza-Jonas <[email protected]>
1 parent 3abf853 commit 5c726bd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

utils/pb-console

+1-2
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,11 @@ fi
135135
dmesg -n 1
136136

137137
trap '' SIGINT
138+
trap 'reset; echo "SIGTERM received, booting..."; sleep 2' SIGTERM
138139

139140
while :
140141
do
141142
$ui $verbose_opt
142143
reset
143-
echo "Exiting petitboot. Type 'exit' to return."
144-
echo "You may run 'pb-sos' to gather diagnostic data"
145144
$shell
146145
done

0 commit comments

Comments
 (0)