Subject: Re: Kernel <-> init communication for shutdown
To: Greywolf <greywolf@starwolf.com>
From: Nathan J. Williams <nathanw@MIT.EDU>
List: tech-kern
Date: 01/14/2001 22:27:41
Greywolf <greywolf@starwolf.com> writes:

> # It's true that other processes don't get to do that, but we're talking
> # about messages communicated from the kernel. The kernel uses
> # trapsignal() all the time to pass extra information about various
> # things in the sigcode.
> 
> Well, yeah, but the powerbutton stuff is presumably being implemented
> in userland, from the discussions I've seen.

Mmph. I think we crossed wires somewhere.

People have been talking about init(8) doing the actual powerbutton
stuff, and this particular side-topic was about how the kernel would
inform init that one of the Magic Buttons was pressed, so that it
could do its userland work.

> Otherwise it's an intermodal hack to have a userland configuration
> read in parameters which are going to get stuffed into kernel namespace
> so it can call an exec() on it.  That's just ... I don't know, ugly,
> I think, and seems like the wrong way to handle it.

I agree that that's ugly, but I don't think it's what anyone proposed.

It's more like:

1) Kernel input device driver notices a Magic Button was pressed.
2) Kernel tells init about the Magic Button.
3) Init chooses an action based on a configuration file.
4) Init executes the action.

The signal/sigcode, socket, and device stuff were all in the realm of
making (2) happen.

        - Nathan