I use Debian/PPC on an old Mac Mini G4, it currently serve as a DLNA server (UPnP), no mouse or keyboard plugged.
I would like that my power button also serves to shutdown the box. Currently it does nothing, on recent x86 I would have used ACPI as described here.
I could not find whether or not any event (APM type?) is sent when pressing the power button. I know that I can hold the power button for 4s then the machine halt, but I would prefer a clean shutdown. As a last resort I could plug in a keyboard but I am looking for a solution without mouse or keyboard.
How would one do that ?
EDIT: Using web.archive.org I was able to read: http://web.archive.org/web/20110317165103/http://blog.blinker.net/2010/06/20/mac-mini-g4-homeserver-with-ubuntu-linux-10-04-wpa2/
I used the solution suggested:
I got this working on my G4 Quicksilver with Ubuntu by installing pbbuttonsd.
I had to modify /etc/pbbuttonsd.conf and change this line:
OnAC_KeyAction = none
OnAC_KeyAction = shutdown
I ran /etc/init.d/pbbuttonsd restart to restart the daemon, and then the power button worked to trigger a clean shutdown.
But this did not work for me, maybe there is a difference in between PowerBook and Mac Mini G4.