Bug 470752 - ACPID is claiming power button even when gnome-power-manager is running
ACPID is claiming power button even when gnome-power-manager is running
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: acpid (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Zdenek Prikryl
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-09 19:35 EST by Martin Ebourne
Modified: 2008-11-12 01:33 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-12 01:33:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Ebourne 2008-11-09 19:35:51 EST
Description of problem:
If I press the laptop power button to suspend to RAM (as configured in g-p-m and as was working for F9) the machine shuts down.

Version-Release number of selected component (if applicable):
acpid-1.0.6-8.fc10.x86_64
ConsoleKit-0.3.0-2.fc10.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. Press power button

Actual results:
Machine shuts down

Expected results:
Action configured as per g-p-m should occur.

Additional info:
Looks like ConsoleKit has changed the output of ck-list-sessions:

# ck-list-sessions
Session2:
        unix-user = '500'
        realname = 'Martin Ebourne'
        seat = 'Seat1'
....

UID is 'unix-user' whereas /etc/acpi/actions/power.sh is looking for 'uid':

ck-list-sessions | \
awk '
/^Session[0-9]+:$/ { uid = active = x11 = "" ; next }
{ gsub(/'\''/, "", $3) }
$1 == "uid" { uid = $3 }

Changing this to:

$1 == "unix-user" { uid = $3 }

fixes the problem. Could be more fancy and check for either I guess.
Comment 1 MartinG 2008-11-11 05:41:15 EST
I can confirm that /etc/acpi/actions/power.sh does not correctly detect a running kpowersave (the g-p-m for KDE4). My power.sh script does detect the correct uid, but it fails to match the output of ps, as "ps axo uid,cmd" outputs "/usr/bin/kpowersave" and not "kpowersave". Maybe this also goes for gnome-power-manager?

On this box I'm running Fedora 9, 2.6.26.6-79.fc9.x86_64., pm-utils-1.1.0-7.fc9.x86_64.

In /etc/acpi/actions/power.sh, if I change "kpowersave" to "/usr/bin/kpowersave", I get the wanted behaviour.

The man page of "ps" states that "cmd" means the "simple name of executable", which I guess means the full path including the name, but not the option list.
Comment 2 Martin Ebourne 2008-11-11 06:00:58 EST
MartinG, that is clearly a different but very much related bug.

My issue is due to a change in Fedora 10 that breaks the UID check. It was working on F9 and it works on F10 once I fix the check. I am using gnome though.

Looks like in the KDE case it's already broken on F9. Not currently at my machine so can't check to see if there's any change in that for F10.

Is anyone looking at this bug? Can we get this fixed before F10 final? From my experience having the power button shut the machine down when the user only expected it to suspend to RAM is very unpleasant.
Comment 3 Zdenek Prikryl 2008-11-11 08:27:59 EST
(In reply to comment #0)
> fixes the problem. Could be more fancy and check for either I guess.

I think check for "unix-user" is sufficient. 

(In reply to comment #1)
> In /etc/acpi/actions/power.sh, if I change "kpowersave" to
> "/usr/bin/kpowersave", I get the wanted behaviour.

I'll fix the script in other way, instead "==" I'll use "~". This solution catches either kpowersave or /usr/bin/kpowersave.

Also I'll try to get this update to the F-10 final.
Comment 4 MartinG 2008-11-11 08:47:01 EST
Great - thanks :)

Note You need to log in before you can comment on or make changes to this bug.