April 2, 2016

Fix automatic suspend in Lubuntu

If you get the error "Authentication required before suspend" when the PC tries to suspend automatically, the actions below are required.

In the file "/usr/share/polkit-1/actions/org.freedesktop.login1.policy" search the section "<action id="org.freedesktop.login1.suspend">" and change the corresponding lines as below:

<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>

An alternative solution, which is supposed to be permanent since the file above is updated occasionally, is given next.

Go to "/etc/polkit-1/localauthority/50-local.d/" and create a file named for instance "com.0.enable-automatic-suspend.pkla". Put the following text into the file:

[Enable automatic suspend]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend
ResultAny=yes

Based on http://askubuntu.com/questions/785509/hibernating-from-cron/786225#786225

No comments:

Post a Comment