how to handle system shutdown ?

From: Jeff <>
Date: Fri, 03 May 2019 03:37:00 +0200

> And of course you'd need a shutdown script that PID1
> can call when it gets signals to reboot or poweroff.

that is also an interesting point.

i personally added this to my init. it ran a sript with the received
signal's name and number as parameters to let the user decide
what to do about it (i am also used to shut my desktop down via
"kill -12 1 ; exit 0").

but one can do without it and call the shutdown script by hand
which in the end does the reboot(2) call itself, thats perfectly
possible and the classical BSD way, so process #1 does not even
need to do the system shutdown itself.

but reacting to signals other than SIGCHLD is necessary on Linux
(and probably also the BSDs on PC hardware) to react to incoming
signals sent by the kernel when the "3 finger salute" and other
recognized special key sequences are hit (Linux: SIG(INT,WINCH),
dunno what the BSDs use here).
Received on Fri May 03 2019 - 01:37:00 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC