Asking for authentication on automatic suspend on XFCE

If none of the more specific forums is the right place to ask

Asking for authentication on automatic suspend on XFCE

Postby andoru » 2021-02-13 23:21

So, I've been having issues with automatic suspend-to-RAM on my XFCE machines. One doesn't do this automatically, and when I log into my account (light-locker), I get prompted for a password in order to suspend. The other machine on which I have issues is when I have multiple users logged in, and the PC is supposed to suspend, I also get an authentication prompt. If need-be, I'll also post the outputs from that machine.
So I've found this useful post on XFCE forums.
I followed along with the thread, and here are the relevant outputs I got:

Code: Select all
$ groups
andoru cdrom floppy sudo audio dip video plugdev vboxusers netdev


Code: Select all
$ cat /etc/systemd/logind.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
HandlePowerKey=suspend
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=ignore
HandleRebootKey=reboot
PowerKeyIgnoreInhibited=no
SuspendKeyIgnoreInhibited=no
HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodes=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192


Code: Select all
# journalctl --no-pager -u polkit | grep FAILED
[...]
Feb 11 01:34:22 polkitd(authority=local)[598]: Operator of unix-session:2 FAILED to authenticate to gain authorization for action org.freedesktop.login1.suspend for system-bus-name::1.35 [xfce4-power-manager] (owned by unix-user:andoru)
Feb 12 21:11:59 polkitd(authority=local)[598]: Operator of unix-session:2 FAILED to authenticate to gain authorization for action org.freedesktop.login1.suspend for system-bus-name::1.35 [xfce4-power-manager] (owned by unix-user:andoru)
Feb 13 05:12:42 polkitd(authority=local)[598]: Operator of unix-session:2 FAILED to authenticate to gain authorization for action org.freedesktop.login1.suspend for system-bus-name::1.35 [xfce4-power-manager] (owned by unix-user:andoru)


Seeing as I had the same output as the guy in the thread, I followed the instructions on the linked article
Then I looked at how I should make polkit rules on Debian, and made this file:
Code: Select all
$ cat /usr/share/polkit-1/rules.d/10-suspend.rules
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.login1.suspend" &&
        subject.isInGroup("users")) {
        return polkit.Result.YES;
    }
});


But still I get that authentication prompt, even after a complete restart.
What gives? Is there something I'm missing?

I've also tried killing light-locker as was instructed in the thread linked above, and it did seem to want to suspend without password confirmation, but this time I got this message:
Image
So it still wouldn't suspend automatically, when it's actually supposed to... aside for the blow to security.
andoru
 
Posts: 267
Joined: 2014-03-14 16:59

Re: Asking for authentication on automatic suspend on XFCE

Postby andoru » 2021-02-17 03:18

Alright.
So now that I started light-locker again, and lowered the power saving setting to 15 minute, it finally would suspend the machine. The only problem is that it would suspend while just watching a longer video in VLC... (which is NOT what it's supposed to do)
After fiddling with the power setting, and placing it on 30 minutes, the PC refuses to suspend without root password, AGAIN!
Same thing that asks me for a password pops up again...
This is really frustrating. Why can't I have some properly working power saving settings without having to fiddle with everything...?
andoru
 
Posts: 267
Joined: 2014-03-14 16:59


Return to General Questions

Who is online

Users browsing this forum: No registered users and 15 guests

fashionable