Possible Duplicate:
How to shutdown/restart/suspend … without authentication or confirmation?
If shutdown asks for password (and so does every program which has the option to turn off after finishing something), how does the shutdown button work if it does not ask for it?
A window manager can be configured to ask (like
gnome-power-manager
), but the system itself does not ask (e.g.: viainit
orshutdown
). Most computers now have an electronic power switch that sends a signal to the computer. The computer receives the signal and does whatever it was configured to do with it.You didn't say which version. I think... I am not entirely sure, but I think I remember this being slightly different on different versions...
So... what's doing it? Open a terminal...
Is the button kernel module loaded? (
lsmod | grep button
)Yes? The kernel is receiving the signal and passing it to another program.
Is acpid running? (
ps -A | grep acpi
)Yes? ACPI (Advanced Configuration and Power Interface) handles the signal.
So let's look in /etc/acpi/... You should have a "powerbtn.sh" file or something similar depending on your version of Ubuntu and/or ACPI. At the end of that script you see what happens:
And if we do a
man shutdown
from a terminal, we can see the meaning of switches...If you want to configure the button... this seems to be a good post if you are using Gnome. I am fairly certain that this is a version-specific question, but these I hope are good clues.
The password is used from the user to temporary gain privilaged access to the system, and shutting down the computer is a privilaged operation.
On the other hand the press of the button is caught by the kernel, which already has the privilages for the operation.