[Pkg-utopia-maintainers] Bug#639754: [upower] upower doesn't verify correctly the "suspend" and "hibernate" capabilities correctly

Francesco Muzio muziofg at gmail.com
Mon Aug 29 22:21:07 UTC 2011


Package: upower
Version: 0.9.12-1
Severity: normal

upower doesn't verify correctly
the "suspend" and "hibernate" capabilities correctly

In the first, brutal, test I have removed pm-utils (used in upower for 
check the two capabilities) with

dpkg -P --force-depends pm-utils

but surprisingly
upower -d | grep can

print on my screen this:

   can-suspend:     yes
   can-hibernate    yes

Then I have reinstalled the pm-utils and...
I have tryed two configuration for my custom kernel

1_ a kernel without any powermanagement support (and hence without a 
readable /sys/power/state)
2 a kenrel with a stupid power management (no susped and no hibernation 
support compiled in) with an empty /sys/power/state

Now in both case the

/usr/bin/pm-is-supported --suspend
echo $?

and

/usr/bin/pm-is-supported --hibernate
echo $?

show that the returned value is not 0 (it means NOT supported)
In the particular case with a not existent  /sys/power/state it return 
with a readable error.

but  in both cases the command

upower -d | grep can

print on my screen this:

   can-suspend:     yes
   can-hibernate    yes


upower uses the up_backend_supports_sleep_state() function located in 
/src/linux/up-backend.c for done a test on the capabilities (suspend, 
hibernate) This function call /usr/bin/pm-is-supported with 
g_spawn_command_line_sync() wich return a value.

I'm not an expert, but seems that the value returned by 
up_backend_supports_sleep_state() is never false.
It should return false when /usr/bin/pm-is-supported return a non 0 value.


--- System information. ---
Architecture: i386
Kernel: Linux 3.0.0

Debian Release: wheezy/sid
500 testing ftp.it.debian.org

--- Package information. ---
Depends (Version) | Installed
=======================================-+-==============
libc6 (>= 2.3.6-6~) | 2.13-16
libdbus-1-3 (>= 1.0.2) | 1.4.14-1
libdbus-glib-1-2 (>= 0.88) | 0.94-4
libglib2.0-0 (>= 2.26.0) | 2.28.6-1
libgudev-1.0-0 (>= 146) | 172-1
libimobiledevice1 (>= 0.9.7) | 1.0.6-3
libplist1 (>= 0.16) | 1.6-2
libpolkit-gobject-1-0 (>= 0.99) | 0.102-1
libupower-glib1 (>= 0.9.2) | 0.9.12-1
libusb-1.0-0 (>= 2:1.0.8) | 2:1.0.8-4
udev | 172-1
dbus | 1.4.14-1
pm-utils | 1.4.1-8


Recommends (Version) | Installed
==========================-+-===========
policykit-1 | 0.102-1


Package's Suggests field is empty.








More information about the Pkg-utopia-maintainers mailing list