Messages in this thread | | | From | (Miquel van Smoorenburg) | Subject | Re: Let init know user wants to shutdown | Date | Tue, 10 Apr 2001 23:20:24 +0000 (UTC) |
| |
In article <20010405000215.A599@bug.ucw.cz>, Pavel Machek <pavel@suse.cz> wrote: >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 >read such event. [I hunted bug for few hours, thinking that kernel >does not get the event at all]. > >Here's patch to do that. Please apply,
Not so hasty ;)
>+ printk ("acpi: Power button pressed!\n"); >+ kill_proc (1, SIGTERM, 1);
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 ?
Mike.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |