1

When pressing the power-button inside a (gnome-)session, ubuntu asks me what to do and shuts down after 60 seconds anyway. No problem so far. But if i'm not logged in in a gnome-session (for example in the login screen), or just change to a tty, then the power-button won't work. But i remember that i worked in 11.04. So what's changed and how to restore?

Background: I use my machine as a print server. If im not home and my wife wants to print sth., she used to switch on my machine, print via her laptop, and then just shut it down by power-button. Beginning of march i was on a business tour, and she called me that she could not shutdown my machine anymore. I shut it down by ssh, but this seems not the favorable way to me.

I already had a look in /etc/acpi/powerbtn.sh and think that the line if pidof x $PMS > /dev/null; then exit is the cause for this since it aborts the script when no gui-power-manager is found. Is that right? But that does not explain with the power-button does not work when switching from the x11-session to a tty, although this would not be critical to me.

1 Answer 1

0

... aborts the script when no gui-power-manager is found ...

The opposite is true. When any user with any gui-power-manager is running, the script is aborted.

It seems that when you switch to another console and log in as the same user that runs the X11 session, the script assumes that you are on the X11 session and that the g-p-m will handle the key press; probably the gui-power-managers nowadays are smart enough to understand that they are not the active console and ignore the key.

(edit) Just tried it:

  • The script only shut down on a console, when no x11 session is present, regardless of the users logged in
  • It will even fail to shut down when only lightdm is presenting its login prompt.

You should file a bug or add a 'me too' to an existing one.

1
  • Oh, sorry, im more into c than bash. It looks like the gnome-settings-daemon is running even if not logged in. I found a pre-11.10 powerbtn.sh where gnome-power-manager was referenced. Although this package is installed in 11.10, it does not seem to handle power management. I replaced it with gnome-session, which is a good work-around for me when not logged in. I also filed this as bug #962086, if you're interested.
    – RJdaMoD
    Mar 22, 2012 at 11:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .