Re: Let init know user wants to shutdown

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

Hi!

> > >Init should get to know that user pressed power button (so it can do
> > >shutdown and poweroff). Plus, it is nice to let user know that we can
> >
> > Not so hasty ;)
> >
> > >+ printk ("acpi: Power button pressed!\n");
> > >+ kill_proc (1, SIGTERM, 1);
>
> [reasons deleted]
>
> Is using a signal the appropriate thing to do anyway?
>
> Wouldn't there be better solutions?
>
> Perhaps a mechanism a user space program can use to communicate to the kernel
> (ala arpd/kerneld message queues, or something like klogd). Then a more
> general user space tool could be used that would do policy appropriate
> stuff, ending with init 0.

init _is_ the tool which is right for defining policy on such issues.

Take a look how UPS managment is handled.

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