[Techtalk] Automatic shutdown when pressing power button

Therese Gustafsson therese_gustafsson at home.se
Mon Sep 18 17:53:14 UTC 2006

Wim De Smet wrote:
> Now linux has specific modules to "catch" these events and send them
> to a userspace program (something that's not part of the kernel). The
> first thing you'd need to do is verify the following:
> - is the "button" kernel module being loaded (check with lsmod | grep
> button)
> - is the acpid program installed and working? (ps -A | grep acpi)
> - is it taking the right action for the powerbutton?
> The first 2 are pretty trivial since you can load the module manually
> (modprobe button) and put it in /etc/modules, if acpid is not
> installed you can do aptitude install acpid or something similar with
> your favourite apt front-end. The last part is a bit tricky since
> there are several ways this could work.
> You mentioned you switched to fluxbox from gnome, maybe all acpid does
> is pass the event to hal which passes the event to gnome which does
> the shutdown. The event is normally configured in /etc/acpi/events.
> Could be that there's a package which does what you want when you
> install it though so you could do a search for 'acpi' first (aptitude
> search acpi for instance). Otherwise you can just edit the 'action'
> part to point to a script of your making or that is still available on
> your system (in /etc/acpi typically) and do it there.
> I hope that gets you on the right track, I tried to search ubuntu.com
> for something about this but didn't immediately come up with anything.
> HTH,
> Wim


Thanks for the great explanation. acpid wasn't installed, so I installed
it and checked that the "button" module was loaded and that the
powerbutton event was configured and that was it. It works again! Yay!


More information about the Techtalk mailing list