Subject: Re: Kernel <-> init communication for shutdown
To: Ty Sarna <tsarna@endicor.com>
From: Luke Mewburn <lukem@wasabisystems.com>
List: tech-kern
Date: 01/15/2001 09:01:17
On Sun, Jan 14, 2001 at 05:28:43PM +0000, Ty Sarna wrote:
> In article <200101141322.f0EDMhc23515@night-porter.duskware.de>,
> Martin Husemann  <martin@duskware.de> wrote:
> > I'd like to propose a slight change to /sbin/init: there are several 
> > architectures which have some sort of "power" button on their keyboard
> [...]
> > Actually (maybe enabled/disabled by a kernel option) this could also be
> > mapped to the Ctrl-Alt-DEL keysequence.)
> [...]
> > I'd like to implement something like this for NetBSD and am looking for 
> > comments on design and possible implementations.
> 
> How about the following?
> 
> - Power button sends init SIGPWR
> - Ctrl-Alt-Del (or platform equivalent if there is one) sends init SIGUSR1
> - Other special key, if any, sends init SIGUSR2
> 
> on receipt of SIGPWR/SIGUSR1/SIGUSR2, if /etc/initbuttons (or something
> better named) exists, execute it with arg power/ctrlaltdel/other.
> We supply the defaults below.
> 
> This should make everyone happy. People running systems who don't want
> anything to happen get their wish by default. People who do can enable
> it easily. People who have some other thing they'd like the commands to
> do (run a screen lock command or whatever) can get that behavior.

Sounds like a fairly reasonable idea to me. You've allowed for the
fact that people may not like this change by disabling it by default,
you've made it easy to configure, etc.

I'm not sure about having the script as "/etc/initbuttons"; we're
trying to remove the dependence upon scripts in /etc. /etc/rc et al
are there because of hysterical^Whistorical precedence.