Bug 564119

Summary: powersave -U doesn't work
Product: [openSUSE] openSUSE 11.3 Reporter: Lars Müller <lmuelle>
Component: BasesystemAssignee: Danny Al-Gaaf <dalgaaf>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P4 - Low CC: sbrabec
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 11.2   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Lars Müller 2009-12-11 18:36:01 UTC
lmuelle@giles:~/Dokumente> powersave -U
Error org.freedesktop.Hal.Device.UnknownError: error: org.freedesktop.Hal.Error: Could not determine whether caller is privileged 
 org.freedesktop.Hal.Device.Error

lmuelle@giles:~/Dokumente> uname -a
Linux giles 2.6.32-3-desktop #1 SMP PREEMPT 2009-12-04 00:41:46 +0100 x86_64 x86_64 x86_64 GNU/Linux
lmuelle@giles:~/Dokumente> rpm -qf /usr/bin/powersave
pm-utils-0.99.4.20071229-19.4.x86_64
Comment 1 Michal Vyskocil 2009-12-15 09:21:29 UTC
This seems to be some Hal/PolicyKit problem - on my machine it works well under root and normal user.

But powersave has been deprecated in pm-utils-1.2.6.1 currently going to Factory - in 11.2 please use /usr/sbin/pm-hibernate instead.
Comment 2 Lars Müller 2009-12-15 11:04:22 UTC
lmuelle@giles:~/Dokumente> /usr/sbin/pm-hibernate
This utility may only be run by the root user.
lmuelle@giles:~/Dokumente> cat /etc/SuSE-release 
openSUSE 11.3 Milestone 0 (x86_64)
VERSION = 11.3

And I have the sam issue with a second system.
Comment 3 Michal Vyskocil 2009-12-15 14:25:30 UTC
Stanislav, can you help me with a "Could not determine whether caller is privileged" error.

Lars, can you try this D-BUS call from command line? But be aware this should be fixed only for 11.2, where the legacy powersave script exists, newest pm-utils will not contain it.

dbus-send --system --print-reply --dest=org.freedesktop.Hal \
 /org/freedesktop/Hal/devices/computer  \
 org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate
Comment 4 Lars Müller 2009-12-15 14:34:19 UTC
If it's fixed for 11.2 I miss the point why I should test this on a Factory/ 11.3 system.  See the product I filed this bug report for. ;)
Comment 5 Michal Vyskocil 2009-12-15 14:47:57 UTC
You can test it on any suitable system (11.2/11.3/Factory) - I just want to know if the manual dbus-send will work or not. But this would be fixed only on 11.2, the next release will not contain this script (at least in pm-utils package).
Comment 6 Stanislav Brabec 2009-12-15 16:39:42 UTC
The error message above is created by HAL if access_check_caller_have_access_to_device() returns < 0. It is a PolKitResult code of PolicyKit/polkit polkit_context_can_caller_do_action() call. Value < 0 is not known by PolKitResult.

=>

a) hal was not compiled with PokicyKit/polkit support

or

b) something went wrong and polkit_context_can_caller_do_action() returned < 0.
Comment 7 Michal Vyskocil 2010-01-06 14:30:40 UTC
moving to the HAL maintainer, because it's not a pm-utils bug.
Comment 8 Danny Al-Gaaf 2010-02-22 15:27:27 UTC
Please check if there is a XDG_SESSION_COOKIE in the environment of your session. Sounds to me like a ConsoleKit problem. Btw. was the command called from a desktop session?
Comment 9 Danny Al-Gaaf 2010-02-22 15:33:15 UTC
(In reply to comment #6)
> a) hal was not compiled with PokicyKit/polkit support

AFAICS: hal was/is compiled with Policy-/ConsoleKit support
Comment 10 Lars Müller 2010-03-12 13:42:28 UTC
lmuelle@giles:~> echo $XDG_SESSION_COOKIE
b210b0bb96a041782b415b0848a2d1f0-1267988246.355878-99361392

The system is no running 11.3 Milestone 3 (2.6.33-5-default).

hal-0.5.14-2.10.x86_64
ConsoleKit-0.4.1-2.11.x86_64
PolicyKit-0.9-18.10.x86_64

I'm facing the same issue on a second system which is at the same Factory package level.

Calling s2disk as non root user results in:

lmuelle@giles:~> /usr/sbin/s2disk -r /dev/sdb1
s2disk: Could not lock myself. Reason: Cannot allocate memory

As root it works.
Comment 12 Holger Macht 2010-04-13 19:50:06 UTC
Please try with Factory/Milestone 5. In fact, I think this got fixed with Milestone 4 already, but I don't know the root cause.
Comment 13 Danny Al-Gaaf 2010-09-13 15:14:59 UTC
no new info since 5 months, close bug now as FIXED.