Bug 819559 - acpid's /etc/acpi/actions/power.sh malfunction in kde
acpid's /etc/acpi/actions/power.sh malfunction in kde
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: acpid (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jaroslav Škarvada
Fedora Extras Quality Assurance
: Patch
Depends On: 831977
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-07 10:24 EDT by Rex Dieter
Modified: 2012-07-09 11:35 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-25 20:48:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch acpid.power.sh to use systemd-loginctl too (740 bytes, patch)
2012-05-07 11:23 EDT, Rex Dieter
no flags Details | Diff
Proposed fix (770 bytes, patch)
2012-06-14 04:38 EDT, Jaroslav Škarvada
no flags Details | Diff
Proposed fix (745 bytes, patch)
2012-06-14 04:44 EDT, Jaroslav Škarvada
no flags Details | Diff

  None (edit)
Description Rex Dieter 2012-05-07 10:24:31 EDT
Seems acpid's
/etc/acpi/actions/power.sh
no longer functions properly on f17 and kde (at least).  It acts unconditionally on power button presses.

I'm not sure exactly yet, but I suspect may be related to
http://fedoraproject.org/wiki/Features/ckremoval

and the script's reliance on ConsoleKit (ck-list-sessions) to check for an active session
Comment 1 Rex Dieter 2012-05-07 10:41:55 EDT
OK, found systemd-loginctl which should be able to provide the same information:

systemd-loginctl list-sessions

and then 
systemd-loginctl session-status <session_id>

will include "Active: yes" or not.
Comment 2 Rex Dieter 2012-05-07 11:23:09 EDT
Created attachment 582698 [details]
patch acpid.power.sh to use systemd-loginctl too

an initial proof of concept patch to check for power managers (gnome-settings-daemon, kded4, xfce4-powermanager) running within active sessions handled by systemd login manager.
Comment 3 Rex Dieter 2012-06-13 11:33:08 EDT
ping, someone on kde@lists.fedoraproject.org reported experiencing the same thing today.  Can you please review the patch?  I can commit the fix if you want.
Comment 4 Jaroslav Škarvada 2012-06-14 04:38:58 EDT
Created attachment 591774 [details]
Proposed fix

Thanks for the patch. I fixed the xfce4 typo and hide error message in case the systemd-loginctl list-sessions is not available, otherwise it seems to be OK. Another problem is that the list-sessions call is blocked by SELinux thus with SELinux in enforcing mode it still doesn't work. I filled bug about it bug 831977.
Comment 5 Jaroslav Škarvada 2012-06-14 04:44:20 EDT
Created attachment 591775 [details]
Proposed fix

Of course removed the debug fragment :)
Comment 6 Fedora Update System 2012-06-14 05:06:14 EDT
acpid-2.0.16-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/acpid-2.0.16-2.fc17
Comment 7 Rex Dieter 2012-06-14 07:46:12 EDT
Good fixes, I suppose while you're at it, you probably ought to add
 2>/dev/null after the later call to ck-list-sessions as well (since there's a good chance it's not installed).
Comment 8 Jaroslav Škarvada 2012-06-14 08:59:57 EDT
Thanks, I added this to rawhide.
Comment 9 Kevin Kofler 2012-06-14 09:52:29 EDT
<RANT>And once again we have to get a bugfix copied to the SELinux policy for it to actually work. I'm so fed up of that dumb hardcoded ruleset that keeps thinking it knows better what a program needs to do than the actual program. Now WHY is that software equivalent of nonsensical bureaucracy enabled by default in Fedora?</RANT>
Comment 10 Fedora Update System 2012-06-15 08:25:16 EDT
Package acpid-2.0.16-2.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing acpid-2.0.16-2.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-9464/acpid-2.0.16-2.fc17
then log in and leave karma (feedback).
Comment 11 Fedora Update System 2012-06-25 20:48:54 EDT
acpid-2.0.16-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 David A. De Graaf 2012-07-06 13:57:16 EDT
I'm sorry to report that this fixes nothing for me.

On an i386 netbook, where suspend and hibernate are important functions, both pm-suspend and pm-hibernate start to shutdown but immediately resume normal operation.  The other commands to suspend and hibernate, acpitool -s  and acpitool -S  both complain that "You must have write access to /proc/acpi/sleep", but there is no such "file".

On an x86_64 desktop, where suspend and hibernate are never used, pm-suspend shuts down X and reverts to console 1, but certainly doesn't suspend.  pm-hibernate works correctly - Whoop!  The acpitool options also fail.

The power manager applet also fails on the netbook, although I'm less interested in the GUI methods if the basic Linux commands no longer work.
Comment 13 Rex Dieter 2012-07-06 15:17:14 EDT
Your symptoms don't seem to match this bug at all.

The bug here is that hitting the power button *used* to get intercepted by acpid and immediately shut the machine off, rather than letting kde handle the power button event.
Comment 14 Jaroslav Škarvada 2012-07-09 04:06:24 EDT
(In reply to comment #12)
> On an i386 netbook, where suspend and hibernate are important functions,
> both pm-suspend and pm-hibernate start to shutdown but immediately resume
> normal operation.
>
Try suspend via:
# echo mem > /sys/power/state
and hibernate:
# echo disk > /sys/power/state

If this fail, file a bug on kernel component, otherwise file a bug on pm-utils component.

> The other commands to suspend and hibernate, acpitool -s 
> and acpitool -S  both complain that "You must have write access to
> /proc/acpi/sleep", but there is no such "file".
> 
Please file a bug on acpitool component.

In all cases feel free to CC me (it can sometimes speed things up :)
Comment 15 David A. De Graaf 2012-07-09 11:35:27 EDT
> Try suspend via:
> # echo mem > /sys/power/state
> and hibernate:
> # echo disk > /sys/power/state

Jaroslav Škarvada, you are a magician.  I don't know what hat you pulled these commands out of, but they work perfectly.

I have added two new event files, lidconf and powerconf, to /etc/acpi/events, and corresponding action files containing these echo commands.

/etc/acpi/lidconf:
    event=button/lid*
    action=/etc/acpi/actions/sleep.sh
/etc/acpi/sleepconf: 
    event=button/sleep*
    action=/etc/acpi/actions/hibernate.sh


So now my ASUS N10 netbook with F17 is fully functional again.
   Sleep button (Fn-F1) causes hibernation
   Closing the lid suspends to memory
   Briefly pressing Power Button initiates shutdown

Upon wakeup from sleep or hibernation the wireless connection, managed by NetworkManager, starts right up.  I'm a happy camper.

That pm-sleep and pm-hibernate fail is still a bug, justifying a separate BZ.
Also for acpitool [-s|-S].

Thank you.

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