LXDE shutdown menu needs to check CanSuspend/CanHibernate

Bug #1300798 reported by h koch
60
This bug affects 13 people
Affects Status Importance Assigned to Milestone
lxsession (Ubuntu)
Confirmed
Undecided
Julien Lavergne
Trusty
Confirmed
Undecided
Unassigned

Bug Description

Lbuntu 14.04 hibernation does not work from shutdown menu
If I press hibernation in the shut down menu of Lubuntu 14.04 beta 2 I am forced to enter password and then (after entering correct password) the error "GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Operation not permitted" is displayed.

A similar bug report exists forubuntu 13.10 under number 1245074 , maybe it has the same origin.

Revision history for this message
h koch (hkoch) wrote :

Hibernation by typing "sudo pm-hibernate" in the console works perfectly.

Revision history for this message
Martin Pitt (pitti) wrote :

Yes, we disable hibernation by default in policykit-desktop-privileges. LXDE's session menu needs to check whether suspend or hibernation is possible (CanSuspend/CanHibernate) before offering it, similar to GNOME and Unity's session-indicator. These might not be available due to polkit disabling it, no swap being available, not having enough swap, the machine not supporting suspend, etc.

affects: systemd (Ubuntu) → lxsession (Ubuntu)
summary: - lubuntu 14.04 beta2, hibernate fails with
- "GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Operation not
- permitted"
+ LXDE shutdown menu needs to check CanSuspend/CanHibernate
Revision history for this message
h koch (hkoch) wrote :

Is there any guide, hint or workaround available how I can enable hibernation in Lubuntu until the bug ix fixed? As I mentioned above, hibernation works on my PC, but I like to have it by button instead of a console command and password input.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lxsession (Ubuntu):
status: New → Confirmed
Revision history for this message
FColz (anywhere88) wrote :

Please, tell us how to enable this. I have the same problem, hibernation was working out of the box in 12.04.
None of the tricks for other distributions worked so far.
Thanks.

Revision history for this message
Pepperpot (pepperpot666) wrote :

I have the same problem with Ubuntu Server 14.04 with an LXDE-installation from the repository. I cannot even shutdown/ restart the system that way. I get the same error message.

Revision history for this message
h koch (hkoch) wrote :

I found that you can at least active the menu by doing the following:

Create the file /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

The file must have the following content:

[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes

This will only help, if you can at least hibernate by using the command sudo pm-hibernate as described above.

Revision history for this message
Andrea Zwirner (andrea-6) wrote :

In may case, as stated here: https://help.ubuntu.com/12.04/ubuntu-help/power-hibernate.html

I had to create the file:
/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
with the content:
[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

note upower instead of login1, as suggested by hkoch

Revision history for this message
tchick (monsorno-nospam) wrote :

I make hibernate work by creating the file as described. And I can activate hibernate through the energy settings.

But I cannot activate hibernate through the shutdown menu. This leads to the described error message.

Revision history for this message
Dmitry (dst-works) wrote :

I have the same result:

I make hibernate work by creating the file as described. And I can activate hibernate through the energy settings.

But I cannot activate hibernate through the shutdown menu. This leads to the described error message.

Problem still here.

Revision history for this message
Dmitry (dst-works) wrote :

sorry guys - I was wrong.
Original file content variant works great:

[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes

I can hibernate from shutdown menu now.

Revision history for this message
A. Eibach (andi3) wrote :

to comment 2 :

"Yes, we disable hibernation by default in policykit-desktop-privileges. LXDE's session menu needs to check whether suspend or hibernation is possible (CanSuspend/CanHibernate) before offering it, similar to GNOME and Unity's session-indicator."

Exactly my opinion! DO NOT DISPLAY "Hibernate" if CanHibernate is set to false! Just omit it. When there is no permission, it must not show up and then output this ugly error to the user (which normally will only be useful to power users anyhow).

Revision history for this message
Ahmed (megamorphg) wrote :

1. paste both entries found here:
https://help.ubuntu.com/14.04/ubuntu-help/power-hibernate.html

2. restart your computer
3. enjoy hibernate in lubuntu! (even though restart is faster on my old laptop lol)

Revision history for this message
mkoniecz (matkoniecz) wrote :

"Yes, we disable hibernation by default in policykit-desktop-privileges" - why it was done?

Revision history for this message
Julien Lavergne (gilir) wrote :
Changed in lxsession (Ubuntu):
assignee: nobody → Julien Lavergne (gilir)
Revision history for this message
Aleksandr (akonstantinov) wrote :

Ubunu 14.04 and none of mentioned solutions work.

Revision history for this message
postadelmaga (postadelmaga) wrote :

+1

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lxsession (Ubuntu Trusty):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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