Cannot suspend with xfce4-power-manager

Bug #929537 reported by Andreas Büsching on 2012-02-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Xfce4 Power Manager
Unknown
Unknown
xfce4-power-manager (Ubuntu)
Medium
Lionel Le Folgoc

Bug Description

With 12.04 I can not suspend my netbook (EeePC 1001PXD) anymore. The menu entries for suspend and hibernate are deactivated. When starting the xfce4-power-manager with debug output I get the following:

TRACE[xfpm-power.c:1053] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/line_power_AC0
TRACE[xfpm-power.c:1053] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-power.c:1011] xfpm_power_add_device(): Battery device detected at : /org/freedesktop/UPower/devices/battery_BAT0: ((XfpmDeviceType) XFPM_DEVICE_TYPE_BATTERY)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 124 : ((XfpmButtonKey) BUTTON_POWER_OFF)

xfce4-power-manager-WARNING **: could not map keysym 1008ffa8 to keycode

TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 213 : ((XfpmButtonKey) BUTTON_HIBERNATE)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 150 : ((XfpmButtonKey) BUTTON_SLEEP)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 233 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 232 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-button.c:179] xfpm_button_xevent_key(): Grabbed key 244 : ((XfpmButtonKey) BUTTON_BATTERY)
TRACE[xfpm-battery.c:148] xfpm_battery_refresh_visible(): visible=TRUE: ((XfpmShowIcon) SHOW_ICON_WHEN_BATTERY_PRESENT)
TRACE[xfpm-battery.c:284] xfpm_battery_refresh_icon(): Battery state 4
TRACE[xfpm-power.c:1152] xfpm_power_refresh_adaptor_visible(): Tray icon configuration: : ((XfpmShowIcon) SHOW_ICON_WHEN_BATTERY_PRESENT)
TRACE[xfpm-power.c:1117] xfpm_power_hide_adapter_icon(): Hide adaptor icon
TRACE[xfpm-polkit.c:369] xfpm_polkit_init_data(): Using unix session polkit subject
TRACE[xfpm-polkit.c:456] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.upower.suspend is authorized=TRUE
TRACE[xfpm-polkit.c:456] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.upower.hibernate is authorized=FALSE
TRACE[xfpm-power.c:1152] xfpm_power_refresh_adaptor_visible(): Tray icon configuration: : ((XfpmShowIcon) SHOW_ICON_WHEN_BATTERY_PRESENT)
TRACE[xfpm-power.c:1117] xfpm_power_hide_adapter_icon(): Hide adaptor icon
TRACE[xfpm-polkit.c:456] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.udisks.drive-set-spindown is authorized=TRUE
TRACE[xfpm-disks.c:170] xfpm_disks_get_is_auth_to_spin(): Is auth to spin down disks : 1
TRACE[xfpm-disks.c:147] xfpm_disks_set_spin_timeouts(): On Battery=0 spin_down_enabled=0 timeout=800

TRACE[xfpm-backlight.c:318] xfpm_backlight_brightness_on_ac_settings_changed(): Alarm on ac timeout changed 9
TRACE[xfpm-backlight.c:339] xfpm_backlight_brightness_on_battery_settings_changed(): Alarm on battery timeout changed 120

It looks like the dbus command for hibernate is not allowed. Maybe this is the problem

twoflower > lsb_release -rd
Description: Ubuntu precise (development branch)
Release: 12.04
 --{ (0) /usr/share/polkit-1 }--

twoflower > apt-cache policy upower
upower:
  Installiert: 0.9.15-1
  Kandidat: 0.9.15-1
  Versionstabelle:
 *** 0.9.15-1 0
        500 http://de.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
        100 /var/lib/dpkg/status
 --{ (0) /usr/share/polkit-1 }--
twoflower > apt-cache policy xfce4-power-manager
xfce4-power-manager:
  Installiert: 1.0.10-4ubuntu2
  Kandidat: 1.0.10-4ubuntu2
  Versionstabelle:
 *** 1.0.10-4ubuntu2 0
        500 http://de.archive.ubuntu.com/ubuntu/ precise/universe i386 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: xfce4-power-manager 1.0.10-4ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-14.23-generic 3.2.3
Uname: Linux 3.2.0-14-generic i686
ApportVersion: 1.91-0ubuntu1
Architecture: i386
Date: Thu Feb 9 14:49:32 2012
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427)
SourcePackage: xfce4-power-manager
UpgradeStatus: Upgraded to precise on 2012-02-08 (0 days ago)

Andreas Büsching (crunchy) wrote :
Lionel Le Folgoc (mrpouit) wrote :

Hibernation is deactived by policykit-desktop-priviledges, you can reenable it by editing /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla I think.

I guess that suspend support has been disabled in the kernel:
$ dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend

Error org.freedesktop.UPower.GeneralError: No kernel support

Sorry, nothing xfce4-power-manager can do unfortunately...

Changed in xfce4-power-manager (Ubuntu):
status: New → Invalid
Andreas Büsching (crunchy) wrote :

The suspend command works for me as user and as root:

twoflower # dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
method return sender=:1.46 -> dest=:1.125 reply_serial=2

The machines suspends.

I'm not sure that I understand why both menues entries for suspending to disk and memory are deactivated? Is this really correct?

When I modify the configuration file /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla as you suggested both menu entries are available again.

I think the status invalid is not appropriate as this is not a correct configuration ... whatever software package has the bug ;-)

As the kernel seems to support suspend on my system there seems to be a difference

Linux twoflower 3.2.0-14-generic #23-Ubuntu SMP Fri Feb 3 23:12:54 UTC 2012 i686 i686 i386 GNU/Linux

Should I open a bug for policykit-desktop-privileges?

Lionel Le Folgoc (mrpouit) wrote :

Haha, you're right, there's a typo:

> if ( power->priv->can_suspend && power->priv->auth_hibernate)
                                                                                                      ^^^^^^^^
instead of auth_suspend

I'll add a patch and forward it upstream.

Changed in xfce4-power-manager (Ubuntu):
importance: Undecided → Medium
status: Invalid → Confirmed
assignee: nobody → Lionel Le Folgoc (mrpouit)
Changed in xfce4-power-manager (Ubuntu):
status: Confirmed → Triaged
Andreas Büsching (crunchy) wrote :

Yeah that looks like a typo :-)

That would fix the problem that both buttons are deactivated.

Do you have any idea why hibernate is deactivated via polkit in the first place?

To be honest it is not that important to me as I use suspend to memory ;-)

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xfce4-power-manager - 1.0.10-5ubuntu1

---------------
xfce4-power-manager (1.0.10-5ubuntu1) precise; urgency=low

  * Merge from Debian unstable for the hardening changes (added patches
    were already included in 1.0.10-4ubuntu1 and 1.0.10-4ubuntu2), remaining
    Ubuntu changes:
    - debian/patches:
      + xubuntu_fix-xfconf-type-brightness-level.patch: use the same type when
        writing and reading the brightness level with xfconf.
      + xubuntu_fix-status-icon-other-devices.patch: fix broken status icons
        for other devices (phone, wireless kbd, mouse, etc.).

  * debian/patches:
    - 06_fix-suspend-auth-check.patch: added, correctly check for suspend
      permissions before disabling the corresponding drop-down menu item.
      lp: #929537

xfce4-power-manager (1.0.10-5) unstable; urgency=low

  [ Lionel Le Folgoc ]
  * debian/patches:
    - 03_trap-x-errors.patch: added, fix crash when all outputs don't support
      the backlight property. Closes: #658916
    - 04_clear-idles-for-removed-batteries.patch: added, fix crash when xfpm
      tries to refresh the status icon of a removed battery.
    - 05_fix-brightness-key-modifiers.patch: added, let the brightness keys
      work even when numlock is on.
  * debian/rules:
    - use debhelper 9 hardening support.
  * debian/compat bumped to 9.
  * debian/control:
    - drop hardening-includes build-dep.
    - update debhelper build-dep to 9 for hardening support.
    - add dpkg-dev 1.16.1 build-dep for hardening support.

  [ Yves-Alexis Perez ]
  * debian/watch updated, xfpm has moved to xfce section.
 -- Lionel Le Folgoc <email address hidden> Thu, 09 Feb 2012 21:52:19 +0100

Changed in xfce4-power-manager (Ubuntu):
status: Triaged → Fix Released
Lionel Le Folgoc (mrpouit) wrote :

See Bug #812394 for the rationale deactivation of hibernation (you can override the policy locally, but I don't think we'll change that for Xubuntu)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.