Re: Let init know user wants to shutdown

Pavel Machek
2001-04-16T12:02:27Z

> In article <9b04food@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).

This is ugly as night, but SIGUSR1 looks okay.

--
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.