Skip to content

Commit

Permalink
utils/pb-console: Trap SIGTERM on boot
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
sammj committed Mar 5, 2019
1 parent 3abf853 commit 5c726bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions utils/pb-console
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,11 @@ fi
dmesg -n 1

trap '' SIGINT
trap 'reset; echo "SIGTERM received, booting..."; sleep 2' SIGTERM

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

0 comments on commit 5c726bd

Please sign in to comment.