Re: Let init know user wants to shutdown

Miquel van Smoorenburg
2001-04-10T23:30:48Z

In article <9b04fo$9od$3@ncc1701.cistron.net>,
Miquel van Smoorenburg <miquels@cistron-office.nl> wrote:
>SIGTERM is a bad choise. Right now, init ignores SIGTERM. For
>good reason; on some (many?) systems, the shutdown scripts
>include "kill -15 -1; sleep 2; kill -9 -1". The "-1" means
>"all processes except me". That means init will get hit with
>SIGTERM occasionally during shutdown, and that might cause
>weird things to happen.
>
>Perhaps SIGUSR1 ?

In the immortal words of Max Headroom, t-t-talking to myself ;)

In fact, the kernel should probably use a real-time signal
with si_code set to 1 for ctrl-alt-del, 2 for the powerbutton etc.

It should first check if process 1 (init) installed a handler
for that real-time signal. If not, it should use the old
signals (SIGINT for ctrl-alt-del, SIGWINCH for kbrequest).

Mike.