16

I have Xubuntu 15.04 installed and having some issues with Suspend. It Suspends fine when done from the command line or the shutdown menu or even by closing the lid. I have set the inactivity timer to 15 minutes using xfce power manager for suspend. However, it never suspends because of inactivity. When I log back in after the failure to suspend, I see this message on the top right: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied

I have tried some of the solutions online such as the ones here and here but it didn't make a difference.

Anyone has any ideas of things to try. Is there any logs that can tell me what could be wrong.

3 Answers 3

14

It looks like your user is not allowed to suspend the PC when not logged in.

Open /usr/share/polkit-1/actions/org.freedesktop.login1.policy
with your favorite editor as root and search for entry
<action id="org.freedesktop.login1.suspend">

Change
<allow_inactive>auth_admin_keep</allow_inactive>
to :
<allow_inactive>yes</allow_inactive>

1
  • I required both the change to polkit described in this answer and the change to inactivity-sleep-mode-on-battery for suspend to work on Xubuntu 16.04.3 Sep 27, 2017 at 18:47
12

I had the same issue in Xubuntu 16.04, this fixed it for me:

At the terminal, type:

xfconf-query -c xfce4-power-manager -lv

If the output of the above command doesn't contain the following line:

/xfce4-power-manager/inactivity-sleep-mode-on-battery   1

then, at the terminal type:

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-sleep-mode-on-battery -n -t int -s 1

2
  • Well, I wanted to try this advice, but it did nothing. No output followed. Perhaps because I'm using Ubuntu 16.04 LTS, not Xubuntu 16.04?
    – Anna
    Jul 16, 2017 at 21:27
  • Yes, this solution relates to XFCE, so would be of no use in Ubuntu. Jul 17, 2017 at 1:22
0

Unfortunately neither of the other answers by AlexAndersan and Holy Mackerel helped, and this is still an issue in Jammy. My error message was a bit different though: it spoke of a failure rather than a denied access. From what I understand screen locking relies on gnome-screensaver, which is surprising: I'd expect xflock4 to handle this.

To check whether this can solve your problem, run gnome-screensaver in a terminal, then try suspending your system again. If it works, make the changes permanent by instructing XFCE to launch gnome-screensaver on login (go to Settings -> Session and Startup -> Application Autostart, then add the program, log out, and log back in again). "Launch[ing] GNOME services on startup" doesn't cut it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .