You are not logged in.

#1 2020-10-28 09:11:55

From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

systemd-logind meddles with lidclose event


I've been struggling for a long time with suspend on my Thinkpad X13 AMD.

The system can sleep without issues using the suspend button or systemctl suspend command, but when the lid is closed the laptop immediately wakes up.
Suspending the laptop using its suspend button and then closing the lid immediately wakes it up.
Sometimes though, after a dozen of open/close cycles laptop would sleep.

I tried installing/uninstalling/disabling tlp, KDE power management, edited logind config, nothing helps.

So far I'm using KDE with lid switch events enabled and my logind config is this


Even with this config I see systemd-logind logging lid open / lid close events however.

What I noticed recently is that if I do systemctl stop systemd-logind before I close the lid, the first lidclose always results in correct suspend. I tried this about 10 times, and it is always like this.

So it seems, that somehow systemd-logind is involved.

I double-checked, and I see that systemd-logind process starts automatically 2 seconds after I stop it (and before the lid is closed), but that restart helps anyway.

Any ideas what may be wrong with my system configuration or how to workaround the issue?

Last edited by eDio (2020-10-28 15:29:37)


#2 2020-10-28 14:42:52

From: Netherlands, Europe
Registered: 2005-10-04
Posts: 10,989

Re: systemd-logind meddles with lidclose event

man 5 logind.conf  wrote:

      PowerKeyIgnoreInhibited=, SuspendKeyIgnoreInhibited=, HibernateKeyIgnoreInhibited=, LidSwitchIgnoreInhibited=
           Controls whether actions that systemd-logind takes when the power and sleep keys and the lid switch are triggered are subject to

           high-level inhibitor locks ("shutdown", "sleep", "idle"). Low level inhibitor locks ("handle-power-key", "handle-suspend-key",
           "handle-hibernate-key", "handle-lid-switch"), are always honored, irrespective of this setting.

           These settings take boolean arguments. If "no", the inhibitor locks taken by applications are respected. If "yes", "shutdown",
           "sleep", and "idle" inhibitor locks are ignored.  PowerKeyIgnoreInhibited=, SuspendKeyIgnoreInhibited=, and
           HibernateKeyIgnoreInhibited= default to "no".  LidSwitchIgnoreInhibited= defaults to "yes". This means that when systemd-logind
           is handling events by itself (no low level inhibitor locks are taken by another application), the lid switch does not respect
           suspend blockers by default, but the power and sleep keys do.

Try with LidSwitchIgnoreInhibited=no

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)


#3 2020-10-28 15:36:12

From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Re: systemd-logind meddles with lidclose event

@Lone_Wolf, thanks

I believe I tried that already (without understanding though how it may help, just tried everything that mentions Lid in its name).

Anyway, I tried just now and it does not make any difference at all.

BTW, if this is of any help

This I get in logs when logind is running

Oct 28 17:32:43 iota systemd-logind[782288]: Lid closed.
Oct 28 17:32:46 iota systemd-logind[782288]: Operation 'sleep' finished.
Oct 28 17:32:51 iota systemd-logind[782288]: Lid opened.

I do not get the 2 top lines when systemd-logind was stopped before suspending (so it for example would look like this)

Oct 28 17:32:51 iota systemd-logind[782288]: Lid opened.

Do you think it be something worth reporting to the systemd upstream?


#4 2023-03-05 07:26:54

Registered: 2023-03-05
Posts: 1

Re: systemd-logind meddles with lidclose event


has this topic been resolved? Actually I'm dealing with a similar problem right now.

Thanks in advance!


Board footer

Powered by FluxBB