On 16.04 (XFCE session and others) and possibly later the power-manager is unable to suspend the system when the user is inactive. A PK user-agent dialog is presented for the user to authenticate first - and as this action occurs specifically when the user is idle and away the PC can end up having an unplanned loss of power when the battery is exhausted.
/var/log/auth.log shows:
polkitd(authority=local): Operator of unix-session:c2 FAILED to authenticate to gain authorization for action org.freedesktop.login1.suspend for system-bus-name::1.47 [xfce4-power-manager --restart --sm-client-id 2992705d4-6fa2-4fba-966c-f7631ecd0b46] (owned by unix-user:tj)
The problem seems to be "com.ubuntu.desktop.pkla" is missing an entry to allow Suspend. Currently it only has an entry for hibernate.
Adding the following stanza solves the issue:
[Enable suspend by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.suspend;org.freedesktop.login1.inhibit-handle-suspend-key;org.freedesktop.login1;org.freedesktop.login1.suspend-multiple-sessions;org.freedesktop.login1.suspend-ignore-inhibit
ResultActive=yes
ResultInactive=yes
On 16.04 (XFCE session and others) and possibly later the power-manager is unable to suspend the system when the user is inactive. A PK user-agent dialog is presented for the user to authenticate first - and as this action occurs specifically when the user is idle and away the PC can end up having an unplanned loss of power when the battery is exhausted.
/var/log/auth.log shows:
polkitd( authority= local): Operator of unix-session:c2 FAILED to authenticate to gain authorization for action org.freedesktop .login1. suspend for system- bus-name: :1.47 [xfce4- power-manager --restart --sm-client-id 2992705d4- 6fa2-4fba- 966c-f7631ecd0b 46] (owned by unix-user:tj)
The problem seems to be "com.ubuntu. desktop. pkla" is missing an entry to allow Suspend. Currently it only has an entry for hibernate.
Adding the following stanza solves the issue:
[Enable suspend by default in logind] unix-user: * org.freedesktop .login1. suspend; org.freedesktop .login1. inhibit- handle- suspend- key;org. freedesktop. login1; org.freedesktop .login1. suspend- multiple- sessions; org.freedesktop .login1. suspend- ignore- inhibit
Identity=
Action=
ResultActive=yes
ResultInactive=yes