Subject: Re: Kernel <-> init communication for shutdown
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 01/17/2001 21:03:04
>> 1) Kernel input device driver notices a Magic Button was pressed.
>> 2) Kernel tells init about the Magic Button.

> I don't think it's a good idea to add this mess to init.  Those magic
> buttons are console resources and should be handled by whatever or
> whoever is controlling the console.

(a) There isn't necessarily anyone controlling the console (consider a
box with no getty on the console device);

(b) I trust you mean "physical console", not "possibly
TIOCCONS-redirected console".

> This also brings up the issue of detecting the magic key sequence.
> These codes vary by input device.  Come to think of it, it may be
> better to have the whole issue handled by a userland daemon that
> sniffs the console input stream and detects the sequence itself.

The magic button may not be part of "the console input stream"; I
certainly would be astonished to find that the power button were
considered as an unusual keystroke on the keyboard.  (Especially if I
were using serial console.)

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B