Power button acpi action is bad for gnome (powerbtn.sh)

Bug #8159 reported by Phil Housley
18
Affects Status Importance Assigned to Milestone
acpi-support (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Under KDE, pressing the power button will log everyone out neatly(ish).
Otherwise, it will just start "shutdown -h now". This seems like a bad thing to
do at almost any time, it would probably make more sense to just ignore the
button altogether until something more useful could be done with it.

Revision history for this message
Thom May (thombot) wrote :

Agreed. Just commenting out everything so that people can use it as an example
seems reasonable.

Revision history for this message
Matt Zimmerman (mdz) wrote :

The action of shutting down the system seems perfectly reasonable and
predictable to me.

Revision history for this message
Phil Housley (undeconstructed) wrote :

Shutting down would make sense, if it was done properly. However, just calling
shutdown isn't a good way of closing down a system if it's being used as an X
workstation. At the very least it needs to end all gnome sessions cleanly so
that they are saved and will be restored at next boot; or else every time
someone hits their power button by accident they're going to shoot someone. You
can see how this is done for KDE in the acpi script, but I don't know of any way
to do this properly for gnome.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Sebastien, is there some way to signal GNOME to logout from an external program?

Revision history for this message
Sebastien Bacher (seb128) wrote :

(In reply to comment #4)
> Sebastien, is there some way to signal GNOME to logout from an external program?

No real idea on this for the moment but I'll try to search for it soon.

Revision history for this message
Sebastien Bacher (seb128) wrote :

ok, "gnome-session-save --kill" should be ok for this (thanks Vincent)

Revision history for this message
Matt Zimmerman (mdz) wrote :

Sounds good...Thom, how about it as a TRLS feature?

Revision history for this message
Phil Housley (undeconstructed) wrote :

Having just added myself to the group of people who have hit their power button
by accident and lost work because of it; could the priority on this be a little
higher? Since it seems I can't remember to change it every time even just on my
computers...

Revision history for this message
Thom May (thombot) wrote :

(In reply to comment #7)
> Sounds good...Thom, how about it as a TRLS feature?

totally missed this chunk of thread. Yes, this seems reasonable.

Revision history for this message
Thom May (thombot) wrote :

acpid (1.0.4-1ubuntu5) hoary; urgency=low

  * Ensure the power button kills the gnome session properly. (Ubuntu: #1403)

 -- Thom May <email address hidden> Thu, 17 Mar 2005 17:54:36 +0000

Revision history for this message
Phil Housley (undeconstructed) wrote :

Is this update still queued somewhere? breezy is still using 1.0.4-1ubuntu4
four months on.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Apparently pbbuttonsd causes the logout dialog to appear in GNOME; should we do
the same with acpi?

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #12)
> Apparently pbbuttonsd causes the logout dialog to appear in GNOME; should we do
> the same with acpi?

To clarify this, pbbuttonsd does not cause the Gnome dialog; I recently changed
pbbuttonsd to not do any power button action at all by default in order to not
interfere with the Gnome dialog. Seb, Matthew, which component is actually
responsible for spawning the dialog?

Revision history for this message
Corey Burger (corey.burger) wrote :

Ok, this nasty behaviour has returned in Dapper. Hitting the powerbutton and
having it just shutdown is a VERY bad thing. It should bring up the logout dialog.

Revision history for this message
Martin Pitt (pitti) wrote :

I cannot test this. On powerpc it does what it should, and I don't have an i386
notebook. Please, can somebody who can actually test this take this bug?

Revision history for this message
Corey Burger (corey.burger) wrote :

Pitti, what exactly do you mean by "does what is should"? Does that mean it
shuts down the machine when pressed or that it brings up the logout dialog?

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #16)
> Pitti, what exactly do you mean by "does what is should"? Does that mean it
> shuts down the machine when pressed or that it brings up the logout dialog?

Oh, sorry. It brings up the logout dialog, as requested in several other bugs.
We had the double-action bug (dialog AND immediate suspend) for pbbuttonsd too
in earlier breezy.

Revision history for this message
Martin Pitt (pitti) wrote :

As said in the previous comment, I cannot test this bug since I only have a ppc
notebook (which works fine). I give this bug back to debzilla.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

I agree with Corey here ! It should popup the logout dialog and nothing else.

On my computer, the button is very close to my knee and I can't count the number of time I've lost something by just watching my computer shutting itself down.... (I hear some laugh in the background, please have respect for my sadness.)

This bug is dedicated to the unknown lost data...

Revision history for this message
Tommy Trussell (tommy-trussell) wrote :

I'm adding a comment to this bug because I'd like clarifcation -- I noticed after upgrading to Dapper this system just powers off when I press the power button. In Breezy, pressing the power button initiated a shutdown procedure. I have no idea whether it was "good" from an X perspective, but at least it didn't just kill the power.

I noticed Bug #2882 describing behavior in /etc/acpi/powerbtn.sh but it seems pretty definite that script is NOT being invoked when I press the power button on this (eMonster 550r Desktop) system.

Is mine more likely a bug in the ACPI scripts, or an issue requiring a kernel parameter or other recognition of the power capabilities in the BIOS, or both?

Revision history for this message
Dominic Sacré (dooooomi) wrote :

This is working for me in current dapper, provided that gnome-power-manager ist installed and running. Pressing the power button invokes the logout dialog just fine.

Revision history for this message
Tommy Trussell (tommy-trussell) wrote :

Thanks for the reminder -- I recently updated Bug 39499 because I discovered I could make my system power off properly by adding acpi=force to the kernel parameters. AND it turns out when I do that, the power button behaves as expected, too. (This is using the 686 kernel.)

Under the 386 kernel, the power behaves as expected without adding any kernel parameters.

Revision history for this message
KarlGoetz (kgoetz) wrote :

Hi, was this bug fixed in dapper? if so, could someone close it?
thanks.

Changed in acpi-support:
status: Unconfirmed → Needs Info
Revision history for this message
Tommy Trussell (tommy-trussell) wrote :

Last time I tested it the problem still exists using the 686 kernel on my machine. Using the 386 kernel, it brings up the dialog and shuts the system down properly. Using the 686 kernel the powerbutton kills the power.

My workaround for this is to add acpi=force to the boot parameters when using the 686 kernel. Which I have to redo in grub's menu.lst after every kernel update.

I suspect it's a hardware-specific bug, but I have not tried it on other hardware to narrow it down.

Revision history for this message
Mika Fischer (zoop) wrote :

This is fixed for me in dapper.

Changed in acpi-support:
status: Needs Info → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.