On Wed, 2007-04-25 at 14:58 +0100, MJ Ray wrote:
Also depending on your hardware and kernel it should be possible to set up a clean shutdown from a ACPI powerbutton press event [...]
I've still not got around to doing this and the guides I found are a bit conflicting: what's the best guide out there? As in: what works?
Well to be honest with Ubuntu is has always just been one of those things that has just worked out of the box for me so I have never paid that much attention to exactly how it works :-)
I can see that under /etc/acpi I have a collection of shell scripts, including one called powerbtn.sh.
This script looks for gnome or KDE and signals them to logout/shutdown and if all else fails simply runs a 'shutdown -h now'
This script appears to be launched by acpid via /etc/acpi/events/powerbtn which contains the lines
event=button[ /]power action=/etc/acpi/powerbtn.sh
So I guess assuming your Kernel supports ACPI on your hardware then all acpid does is watch /proc/acpi/events for events and then act on them based on the scripts and events defined in /etc/acpi/
The power button event scripts where added by the acpid package itself on my system, other events and scripts were added by the package acpi-support (most of which seem to be very much Laptop centric)
Hope that helps Wayne