Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

marked as duplicate by James, htorque, Oli Dec 24 '11 at 16:12

This question was marked as an exact duplicate of an existing question.

same question here… – Black Block Dec 23 '11 at 21:57

A window manager can be configured to ask (like gnome-power-manager), but the system itself does not ask (e.g.: via init or shutdown). 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 "" file or something similar depending on your version of Ubuntu and/or ACPI. At the end of that script you see what happens:

/sbin/shutdown -h -P now "Power button pressed"

And if we do a man shutdown from a terminal, we can see the meaning of switches...

  • -h Halt or power off after shutdown.
  • -P Halt action is to turn off the power.

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.

share|improve this answer

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.