! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfpm doesn't manage to get suspend/resume authorization from policykit/consol...
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description Yves-Alexis Perez editbugs 2010-05-21 07:53:29 CEST
Ok, I'm reporting a formal bug. I do have permissions to suspend (they are listed in pkaction) yet xfpm says I can't, and won't let me chose it.

Before xfpm noticed that and changed my actions for SuspendButton/LidClose/PowerButton, I did manage to suspend the laptop.

gnome-power-manager is able to suspend to, so I guess there's a problem when contacting consolekit about that.

Feel free to ask more information if needed.
Comment 1 Lionel Le Folgoc 2010-05-22 21:43:40 CEST
Just to add my 2 cents: same here on both Debian unstable and Xubuntu lucid (consolekit 0.4.1, xfpm 0.9.98).
Comment 2 Ali Abdallah editbugs 2010-05-30 13:22:26 CEST
Can you please start xfpm with xfce4-power-manager --debug and attach the full output here.
Comment 3 Yves-Alexis Perez editbugs 2010-05-30 14:05:37 CEST
(In reply to comment #2)
> Can you please start xfpm with xfce4-power-manager --debug and attach the full
> output here.

Here it is:


corsac@hidalgo: xfce4-power-manager --debug
TRACE[xfpm-main.c:205] xfpm_start(): Starting the power manager
TRACE[xfpm-xfconf.c:154] xfpm_xfconf_load(): Using default configuration for show-brightness-popup
TRACE[xfpm-xfconf.c:154] xfpm_xfconf_load(): Using default configuration for spin-down-on-ac
TRACE[xfpm-xfconf.c:154] xfpm_xfconf_load(): Using default configuration for spin-down-on-ac-timeout
TRACE[xfpm-xfconf.c:154] xfpm_xfconf_load(): Using default configuration for spin-down-on-battery-timeout
TRACE[xfpm-power.c:949] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/line_power_AC
TRACE[xfpm-power.c:949] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-power.c:906] xfpm_power_add_device(): Battery device detected at : /org/freedesktop/UPower/devices/battery_BAT0: ((XfpmDeviceType) XFPM_DEVICE_TYPE_BATTERY)
TRACE[xfpm-battery.c:135] xfpm_battery_refresh_visible(): visible=TRUE: ((XfpmShowIcon) SHOW_ICON_ALWAYS)
TRACE[xfpm-battery.c:165] xfpm_battery_refresh_icon(): Battery state 4
TRACE[xfpm-power.c:1048] xfpm_power_refresh_adaptor_visible(): Tray icon configuration: : ((XfpmShowIcon) SHOW_ICON_ALWAYS)
TRACE[xfpm-power.c:1013] xfpm_power_hide_adapter_icon(): Hide adaptor icon
TRACE[xfpm-polkit.c:273] xfpm_polkit_init_data(): Using ConsoleKit session Polkit subject
TRACE[xfpm-polkit.c:407] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.upower.suspend is authorized=FALSE
TRACE[xfpm-polkit.c:407] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.upower.hibernate is authorized=FALSE
TRACE[xfpm-power.c:1048] xfpm_power_refresh_adaptor_visible(): Tray icon configuration: : ((XfpmShowIcon) SHOW_ICON_ALWAYS)
TRACE[xfpm-power.c:1013] xfpm_power_hide_adapter_icon(): Hide adaptor icon
TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 124 : ((XfpmButtonKey) BUTTON_POWER_OFF)

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

TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 213 : ((XfpmButtonKey) BUTTON_HIBERNATE)
TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 150 : ((XfpmButtonKey) BUTTON_SLEEP)
TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 233 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 232 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-polkit.c:407] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.udisks.drive-set-spindown is authorized=FALSE
TRACE[xfpm-disks.c:170] xfpm_disks_get_is_auth_to_spin(): Is auth to spin down disks : 0
** (xfce4-power-manager:21964): DEBUG: Brightness controlled by xrandr, min_level=0 max_level=15
TRACE[xfpm-backlight.c:319] xfpm_backlight_brightness_on_ac_settings_changed(): Alarm on ac timeout changed 9
TRACE[xfpm-backlight.c:340] xfpm_backlight_brightness_on_battery_settings_changed(): Alarm on battery timeout changed 9
TRACE[xfpm-dpms.c:74] xfpm_dpms_set_timeouts(): Settings dpms: standby=0 suspend=0 off=900
Comment 4 Ali Abdallah editbugs 2010-05-30 14:46:20 CEST
in xfpm-polkit.c, can you comment out line 275 (//subject_created = TRUE;) i want to force it to not use consolekit subject.

Attach also the output here please.
Comment 5 Yves-Alexis Perez editbugs 2010-05-30 14:58:05 CEST
Here we go:


corsac@hidalgo: src/xfce4-power-manager --debug
TRACE[xfpm-main.c:205] xfpm_start(): Starting the power manager

(xfce4-power-manager:28496): libxfce4ui-WARNING **: Unable to open "/usr/local/etc/xdg/autostart/xfce4-power-manager.desktop"
TRACE[xfpm-xfconf.c:154] xfpm_xfconf_load(): Using default configuration for show-brightness-popup
TRACE[xfpm-xfconf.c:154] xfpm_xfconf_load(): Using default configuration for spin-down-on-ac
TRACE[xfpm-xfconf.c:154] xfpm_xfconf_load(): Using default configuration for spin-down-on-ac-timeout
TRACE[xfpm-xfconf.c:154] xfpm_xfconf_load(): Using default configuration for spin-down-on-battery-timeout
TRACE[xfpm-power.c:949] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/line_power_AC
TRACE[xfpm-power.c:949] xfpm_power_get_power_devices(): Power device detected at : /org/freedesktop/UPower/devices/battery_BAT0
TRACE[xfpm-power.c:906] xfpm_power_add_device(): Battery device detected at : /org/freedesktop/UPower/devices/battery_BAT0: ((XfpmDeviceType) XFPM_DEVICE_TYPE_BATTERY)
TRACE[xfpm-battery.c:135] xfpm_battery_refresh_visible(): visible=TRUE: ((XfpmShowIcon) SHOW_ICON_ALWAYS)
TRACE[xfpm-battery.c:165] xfpm_battery_refresh_icon(): Battery state 4
TRACE[xfpm-power.c:1048] xfpm_power_refresh_adaptor_visible(): Tray icon configuration: : ((XfpmShowIcon) SHOW_ICON_ALWAYS)
TRACE[xfpm-power.c:1013] xfpm_power_hide_adapter_icon(): Hide adaptor icon
TRACE[xfpm-polkit.c:273] xfpm_polkit_init_data(): Using ConsoleKit session Polkit subject
TRACE[xfpm-polkit.c:320] xfpm_polkit_init_data(): Using unix session polkit subject
TRACE[xfpm-polkit.c:407] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.upower.suspend is authorized=TRUE
TRACE[xfpm-polkit.c:407] xfpm_polkit_check_auth_intern(): Action=org.freedesktop.upower.hibernate is authorized=TRUE
TRACE[xfpm-power.c:1048] xfpm_power_refresh_adaptor_visible(): Tray icon configuration: : ((XfpmShowIcon) SHOW_ICON_ALWAYS)
TRACE[xfpm-power.c:1013] xfpm_power_hide_adapter_icon(): Hide adaptor icon
TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 124 : ((XfpmButtonKey) BUTTON_POWER_OFF)

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

TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 213 : ((XfpmButtonKey) BUTTON_HIBERNATE)
TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 150 : ((XfpmButtonKey) BUTTON_SLEEP)
TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 233 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_UP)
TRACE[xfpm-button.c:187] xfpm_button_xevent_key(): Grabbed key 232 : ((XfpmButtonKey) BUTTON_MON_BRIGHTNESS_DOWN)
TRACE[xfpm-polkit.c:407] 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-manager.c:403] xfpm_manager_set_idle_alarm_on_ac(): setting inactivity sleep timeout on ac to never
TRACE[xfpm-manager.c:429] xfpm_manager_set_idle_alarm_on_battery(): setting inactivity sleep timeout on battery to never
** (xfce4-power-manager:28496): DEBUG: Brightness controlled by xrandr, min_level=0 max_level=15
TRACE[xfpm-backlight.c:319] xfpm_backlight_brightness_on_ac_settings_changed(): Alarm on ac timeout changed 9
TRACE[xfpm-backlight.c:340] xfpm_backlight_brightness_on_battery_settings_changed(): Alarm on battery timeout changed 9
Comment 6 Ali Abdallah editbugs 2010-05-30 15:26:19 CEST
I'm confused, can you print the content of XDG_SESSION_COOKIE.

Which version of the session are you running ? do you start Xfce from gdm ?
Comment 7 Yves-Alexis Perez editbugs 2010-05-30 15:43:37 CEST
(In reply to comment #6)
> I'm confused, can you print the content of XDG_SESSION_COOKIE.

echo $XDG_SESSION_COOKIE
46b1bf41f5a9c90cab6bf7004720fe1b-1274610848.840050-2089536099

> 
> Which version of the session are you running ? do you start Xfce from gdm ?

ii  xfce4-session  4.6.2-1        Xfce4 Session Manager

and yes Xfce started from gdm
Comment 8 Ali Abdallah editbugs 2010-05-30 16:12:03 CEST
I don't really understand the problem, i'using xfce session from git (it does set XDG_SESSION_COOKIE) and everything works fine, the XDG_SESSION_COOKIE that you have is coming from the session opened by gdm, then why using this is a polkit subject result in authorization failure, no idea, in addition gpm is doing the same thing and it is getting authorization.

I'm very confused.
Comment 9 Yves-Alexis Perez editbugs 2010-05-30 16:35:35 CEST
(In reply to comment #8)
> I don't really understand the problem, i'using xfce session from git (it does
> set XDG_SESSION_COOKIE) and everything works fine, the XDG_SESSION_COOKIE that
> you have is coming from the session opened by gdm, then why using this is a
> polkit subject result in authorization failure, no idea, in addition gpm is
> doing the same thing and it is getting authorization.

Would there be another way to check exactly the authorizations I have via the session cookie?
Comment 10 Ali Abdallah editbugs 2010-05-30 16:40:59 CEST
> Would there be another way to check exactly the authorizations I have via the
> session cookie?

No i don't think, i would re-check the polkit code to see if there were anw changes.
Comment 11 Martin Pitt 2010-06-15 09:43:32 CEST
For the record, all GNOME programs I've looked at use pid and start time (by way of polkit_unix_process_new()), so it might be as simple as that the session-id path has never really been used and tested before? I can't get it to work with that either, but if I disable the entire ConsoleKit handling block and thus let it fall back to unix session pid/start time, it works perfectly for me.
Comment 12 Ali Abdallah editbugs 2010-07-12 08:53:27 CEST
(In reply to comment #11)
> For the record, all GNOME programs I've looked at use pid and start time (by
> way of polkit_unix_process_new()), so it might be as simple as that the
> session-id path has never really been used and tested before? I can't get it to
> work with that either, but if I disable the entire ConsoleKit handling block
> and thus let it fall back to unix session pid/start time, it works perfectly
> for me.

Yup, that's what i'm going to do for the 1.0.0.
Comment 13 Yves-Alexis Perez editbugs 2010-07-13 21:53:10 CEST
Is that planned soon? :)
Comment 14 Yves-Alexis Perez editbugs 2010-08-05 06:30:42 CEST
(In reply to comment #13)
> Is that planned soon? :)

Ali, any news on this? It'd be nice to be able to ship xfpm in Squeeze with that bug fixed.
Comment 15 Samuli Suominen 2010-08-11 08:36:53 CEST
*** Bug 6631 has been marked as a duplicate of this bug. ***
Comment 16 Samuli Suominen 2010-08-11 08:38:31 CEST
(In reply to comment #15)
> *** Bug 6631 has been marked as a duplicate of this bug. ***

The annoying, yet mandatory: "Same here. I'm not using Debian or Ubuntu."

Missed this bug and filed duplicate above and filed information there, if that's any use.
Comment 17 Ali Abdallah editbugs 2010-08-12 09:01:40 CEST
(In reply to comment #16)
> (In reply to comment #15)
> > *** Bug 6631 has been marked as a duplicate of this bug. ***
> 
> The annoying, yet mandatory: "Same here. I'm not using Debian or Ubuntu."
> 
> Missed this bug and filed duplicate above and filed information there, if
> that's any use.

Fixed in version 1.0.0

Bug #6462

Reported by:
Yves-Alexis Perez
Reported on: 2010-05-21
Last modified on: 2010-08-12
Duplicates (1):
  • 6631 xfce4-power-manager-0.9.98 with policykit fails to query authorization for suspend/hibernate

People

Assignee:
Ali Abdallah
CC List:
3 users

Version

Version:
0.9.98

Attachments

Additional information