You are not logged in.

#1 2019-02-02 10:31:44

fledermann
Member
From: Bielefeld, Germany
Registered: 2013-06-24
Posts: 49

How to troubleshoot systemd not detecting idle state?

I configured my notebook to shut the display off after 5 minutes with dpms, that's working fine.
Systemd suspend over power button, configured in logind.conf, also works. Then I set it to suspend after 10 mins of inactivity, but it never does. The problem is, I don't even know where to start to look - does anyone know how systemd detects idle state?

Last edited by fledermann (2019-02-02 10:32:09)

Offline

#2 2019-02-02 13:09:35

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,794

Re: How to troubleshoot systemd not detecting idle state?

man 5 logind.conf
           Note that this requires that user sessions correctly report the idle status to the system. The system will
           execute the action after all sessions report that they are idle, no idle inhibitor lock is active, and
           subsequently, the time configured with IdleActionSec= (see below) has expired.

Offline

#3 2019-02-07 14:39:37

fledermann
Member
From: Bielefeld, Germany
Registered: 2013-06-24
Posts: 49

Re: How to troubleshoot systemd not detecting idle state?

I saw that, but that message is very unspecific. What sessions do report idle status? DM sessions? Apparently not, because both lightdm (or lightlocker with --idle-hint) and sddm fail to do so.

I see no config option for sddm regarding idle hints. loginctl tells me about my active session and the missing idlehint:

Id=2
User=1000
Name=
Timestamp=Thu 2019-02-07 15:08:58 CET
TimestampMonotonic=12319666
VTNr=1
Seat=seat0
Display=:0
Remote=no
Service=sddm
Desktop=i3
Scope=session-2.scope
Leader=8232
Audit=2
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
LockedHint=no

Google isn't exactly helpful either.

Last edited by fledermann (2019-02-07 14:44:19)

Offline

#4 2019-02-07 14:52:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,794

Re: How to troubleshoot systemd not detecting idle state?

Gnome does. Maybe KDE.
I don't think any other process ever supported this.

Display managers are by definition no sessions ;-)

Offline

#5 2019-02-07 15:21:49

fledermann
Member
From: Bielefeld, Germany
Registered: 2013-06-24
Posts: 49

Re: How to troubleshoot systemd not detecting idle state?

Hm, that's too bad. I wouldn't have thought it to be impossible to send my laptop to sleep when idle without using gnome or KDE.

The xss-lock manpage says:

Also, xss-lock manages the idle hint on the login session. The idle state of the session is directly linked to user activity as reported by X (except when the notifier runs before locking the screen). When all sessions are idle, the login manager can take action (such as suspending the system) after a preconfigured delay.

But that doesn't work either. xss-lock appears to be long dead, and there is an open issue regarding idle-hinting.

Offline

#6 2019-02-07 15:24:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,794

Re: How to troubleshoot systemd not detecting idle state?

Of course that's not "impossible", but you asked about systemd's IdleHint.
You can eg. use xautolock to execute random stuff after some idle time.

Offline

#7 2019-02-07 15:45:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: How to troubleshoot systemd not detecting idle state?

fledermann wrote:

Hm, that's too bad. I wouldn't have thought it to be impossible to send my laptop to sleep when idle without using gnome or KDE.

This is the problem with effective monopolies (or duopolies).  The 2 big DEs are being developed to cater to systemd users, and systemd developed to cater to users of the big DEs.  It results in a complete breakdown of modularity.

That said, there is no need to use all these features of systemd targeted at Gnome users - if you don't they are just needless bloat, but no harm.  There are countless other ways to suspend after some idle time ... basically all the ones that existed before systemd added this DE-only feature.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2019-02-08 06:21:24

fledermann
Member
From: Bielefeld, Germany
Registered: 2013-06-24
Posts: 49

Re: How to troubleshoot systemd not detecting idle state?

One working tool for the job would be great, that's why I hoped for systemd. Also, xautolock et al have a lot of shortcomings (not detecting video playback for example).
dpms does detect media playback, so I think I'll use a wrapper script.

Thanks for the help.

Offline

#9 2019-02-08 07:44:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,794

Re: How to troubleshoot systemd not detecting idle state?

not detecting video playback for example

Depends on the video player. mpv/mplayer certainly inhibit it.

Offline

Board footer

Powered by FluxBB