You are not logged in.

#1 2022-05-18 04:12:11

zhaose
Member
Registered: 2022-05-05
Posts: 11

systemd-logind doesn't detect Lid open/closed

I am using GNOME/Wayland
And when I close my laptop's lid, nothing shown in the systemd-logind's log, so my laptop cannot suspend on lid closed, which used to be working.

$ cat /proc/acpi/button/lid/LID/state
state:      open
$ sleep 5 && cat /proc/acpi/button/lid/LID/state # I closed the lid here
state:      closed
$ journalctl -u systemd-logind.service -b -f
 5月 18 11:14:21 Planet systemd[1]: Starting User Login Management...
 5月 18 11:14:21 Planet systemd-logind[516]: New seat seat0.
 5月 18 11:14:21 Planet systemd[1]: Started User Login Management.
 5月 18 11:14:22 Planet systemd-logind[516]: New session 1 of user gdm.
 5月 18 11:14:28 Planet systemd-logind[516]: New session 3 of user zhaose.
 5月 18 11:14:31 Planet systemd-logind[516]: Session 1 logged out. Waiting for processes to exit.
 5月 18 11:14:31 Planet systemd-logind[516]: Removed session 1.

I found a similar topic: https://bbs.archlinux.org/viewtopic.php?id=252773 but it seems not to be solved.
I haven't edited the logind.conf, and the suspend on lib close option in gnome-tweak-tools also is turned on.

Offline

#2 2022-05-18 06:20:36

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

Re: systemd-logind doesn't detect Lid open/closed

Does it work from the multi-user.target (no gnome/GDM/etc)?
See 2nd link below.

Online

#3 2022-05-18 06:53:12

zhaose
Member
Registered: 2022-05-05
Posts: 11

Re: systemd-logind doesn't detect Lid open/closed

seth wrote:

Does it work from the multi-user.target (no gnome/GDM/etc)?
See 2nd link below.

No, nothing changes. When I close and open the lid there still nothing happens, Lid closed and open was not shown in

sudo journalctl --unit=systemd-logind --follow

In addition,

systemctl suspend

always works fine, both under GUI and without GUI
Maybe this is not a desktop problem and I should post is in another section?

Offline

#4 2022-05-18 11:35:14

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

Re: systemd-logind doesn't detect Lid open/closed

Is the lid caught by "sudo libinput debug-events"?

Online

#5 2022-05-18 12:21:40

zhaose
Member
Registered: 2022-05-05
Posts: 11

Re: systemd-logind doesn't detect Lid open/closed

seth wrote:

Is the lid caught by "sudo libinput debug-events"?

Yes, I got these:

-event2   SWITCH_TOGGLE           +5.543s	switch lid state 1
 event2   SWITCH_TOGGLE           +7.051s	switch lid state 0

Offline

#6 2022-05-18 13:38:14

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

Re: systemd-logind doesn't detect Lid open/closed

Does it show up in acpi_listen as well?
https://wiki.archlinux.org/title/Acpid

Wild guess, enable "HandleLidSwitchDocked=suspend" in /etc/systemd/logind.conf

Online

#7 2022-05-18 15:17:51

zhaose
Member
Registered: 2022-05-05
Posts: 11

Re: systemd-logind doesn't detect Lid open/closed

seth wrote:

Does it show up in acpi_listen as well?
https://wiki.archlinux.org/title/Acpid

Wild guess, enable "HandleLidSwitchDocked=suspend" in /etc/systemd/logind.conf

I have already tried enabling "HandleLidSwitchDocked=suspend", it does not work.
The acpi_listen shows LID close and open properly.

Offline

#8 2022-05-18 15:41:20

zhaose
Member
Registered: 2022-05-05
Posts: 11

Re: systemd-logind doesn't detect Lid open/closed

I finally found the problem.
I am using testing repo, and the rc version of systemd may have bugs. I downgrade it to the version in the main repo and it fixed.

Offline

#9 2022-05-18 16:34:22

demaio
Member
From: Germany
Registered: 2012-09-02
Posts: 102
Website

Re: systemd-logind doesn't detect Lid open/closed

Offline

Board footer

Powered by FluxBB