In my case, the /user/share/acpi-support directories were missing. I didn’t know that until I learnt how to debug the power function. For that, I had to look at the ACPI Daemon.
Note: I’m talking about Ubuntu 9.10/10.4 releases here. Your Linux may be different.
The ACPID is what processes any power events. But it wasn’t, and I couldn’t find out why. In the words of Paul Thurrott, if you don’t have what it takes to make Linux work, then you don’t deserve to run it.
And I really wanted to get Linux running, so I persevered.
This is what should happen when the power button is pressed:
- ACPID parses the config file /etc/acpi/events/powerbtn
- ACPID then looks at /usr/share/acpi-support/power-funcs
- ACIPD calls the /etc/acpi/powerbtn.sh
- powerbtn.sh calls shutdown –now
- Linux server powers off.
For me, it failed at step 2.
But to find that out, I had to run this command:
apt-get --reinstall install acpi acpi-support acpid
In conclusion, Linux reminds me of the Planning Department in Hitchhiker’s Guide To The Galaxy. The information is out there, but it’s so frikking hard to find.
“Yes,” said Arthur, “yes I did. It [the planning notice] was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying ‘Beware of the Leopard’.”