Bug 7745

Summary: pm-has-power-policy uses obsolete (hal) interface, system does poweroff immediately instead of configured action
Product: Mageia Reporter: Christian Lohmaier <lohmaier+mageia>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED OLD QA Contact:
Severity: major    
Priority: Normal CC: mageia, pterjan, stormi-mageia
Version: 2Keywords: Triaged
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: pm-utils-1.4.1-4.mga2.src.rpm CVE:
Status comment:

Description Christian Lohmaier 2012-10-09 04:25:16 CEST
Description of problem:
when pressing the power-button, the default/fallback policy runs:

#!/bin/sh
/usr/bin/pm-has-power-policy || /sbin/poweroff

on a system without hal, pm-has-power-policy always returns false, causing the system to poweroff, and that poweroff doesn't give the user a chance to save files, it just sends sigterm to any process immediately.

power-management is provided via upower, so instead of:

$ cat /usr/bin/pm-has-power-policy 
#!/bin/sh
dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply --reply-timeout=200 / org.freedesktop.DBus.NameHasOwner string:org.freedesktop.Policy.Power | grep -q 'boolean true'


the pm-has-power-policy script should check for upower:

dbus-send --system --dest=org.freedesktop.UPower --type=method_call --print-reply --reply-timeout=6000 /org/freedesktop/UPower org.freedesktop.DBus.Properties.Get string:org.freedesktop.UPower string:CanSuspend | grep -q 'boolean true'

if you for some reason want to cover both, just query both:

dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply --reply-timeout=200 / org.freedesktop.DBus.NameHasOwner string:org.freedesktop.Policy.Power | grep -q 'boolean true' || dbus-send --system --dest=org.freedesktop.UPower --type=method_call --print-reply --reply-timeout=6000 /org/freedesktop/UPower org.freedesktop.DBus.Properties.Get string:org.freedesktop.UPower string:CanSuspend | grep -q 'boolean true'

But as hal is being removed from the distro anyway, I don't think that is desirable.

Severity major as contrary to the desktop-environments' shutdown function, there is data-loss, as the user doesn't get a chance to cancel the action and save still opened documents.
Manuel Hiebel 2012-10-10 17:00:50 CEST

CC: (none) => mageia, pterjan

Comment 1 Colin Guthrie 2012-10-10 17:59:41 CEST
I would very much like to drop pm-utils stuff if we can. I think most of it is likely obsoleted by systemd support which obviously does do proper handling of the buttons etc.

But then again this is an mga2 bug so we can't really use that kind of solution here!
Comment 2 Samuel Verschelde 2013-09-03 12:48:18 CEST
Hi, thanks for reporting this bug.
As there is no maintainer for this package we added the packagers who worked on it in the past in CC.

Keywords: (none) => Triaged
CC: (none) => stormi

Comment 3 Manuel Hiebel 2013-10-22 12:11:51 CEST
This message is a reminder that Mageia 2 is nearing its end of life.
Approximately one month from now Mageia will stop maintaining and issuing updates for Mageia 2. At that time this bug will be closed as WONTFIX (EOL) if it remains open with a Mageia 'version' of '2'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Mageia version prior to Mageia 2's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Mageia 2 is end of life.  If you would still like to see this bug fixed and are able to reproduce it against a later version of Mageia, you are encouraged to click on "Version" and change it against that version of Mageia.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Mageia release includes newer upstream software that fixes bugs or makes them obsolete.

-- 
The Mageia Bugsquad
Comment 4 Manuel Hiebel 2013-11-23 16:15:00 CET
Mageia 2 changed to end-of-life (EOL) status on ''22 November''. Mageia 2 is no
longer maintained, which means that it will not receive any further security or
bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of Mageia
please feel free to click on "Version" change it against that version of Mageia
and reopen this bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

--
The Mageia Bugsquad

Status: NEW => RESOLVED
Resolution: (none) => OLD