You are not logged in.

#1 2020-02-09 12:18:14

izflare
Member
Registered: 2020-02-09
Posts: 3

[SOLVED] systemd-logind does not detect Lid open/close correctly

Hi,
I installed Arch Linux in my laptop.
I want to suspend my laptop when the lid closed, but it does not work.
I edited /etc/systemd/logind.conf and uncomment the row of HandleLidSwitch=suspend then sudo systemctl restart systemd-logind, but it does not work. First of all, it seems systemd-logind does not detect lid open/close because journalctl -u systemd-logind -f outputs nothing while I close and open the lid.
However, I run systemctl suspend in another terminal, then close and open the lid, my laptop wakes up from suspend and journalctl -u systemd-logind -f shows the following output:

Feb 09 21:14:56 ArchLinux systemd-logind[392]: Operation `sleep` finished.

How should I do?
Thanks.

Last edited by izflare (2020-02-11 15:59:19)

Offline

#2 2020-02-11 15:58:50

izflare
Member
Registered: 2020-02-09
Posts: 3

Re: [SOLVED] systemd-logind does not detect Lid open/close correctly

I fixed the problem by myself. Thanks.

Offline

#3 2020-02-11 16:01:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,415

Re: [SOLVED] systemd-logind does not detect Lid open/close correctly

Care to share what it was in the end? It might help other people:  https://wiki.archlinux.org/index.php/Co … way_street

Offline

#4 2020-02-13 02:31:41

izflare
Member
Registered: 2020-02-09
Posts: 3

Re: [SOLVED] systemd-logind does not detect Lid open/close correctly

V1del wrote:

Care to share what it was in the end? It might help other people:  https://wiki.archlinux.org/index.php/Co … way_street

Oh, that's true. I'm sorry.
I installed xorg-drivers and xorg-apps via pacman -S and created /etc/X11/Xwrapper.config such as

allowed_users=anybody
needs_root_rights=yes

then the problem was fixed.

Offline

#5 2020-02-14 04:36:33

RoundCube
Member
Registered: 2016-05-14
Posts: 42

Re: [SOLVED] systemd-logind does not detect Lid open/close correctly

That sounds somewhat fishy …
I recall something that HandleLidSwitch in /etc/systemd/logind.conf is ignored if your Desktop Environment handled this, so the right place to check would be you DE's power management setting.

Offline

#6 2020-03-20 04:23:02

YCH
Member
Registered: 2014-01-28
Posts: 53

Re: [SOLVED] systemd-logind does not detect Lid open/close correctly

I have almost same problem.

Laptop : XPS 15 9560
DE : Gnome/wayland

- After cold boot(auto login), power button and lcd brightness up/down buttons  does not working.
- `systemctl suspend` command OK. Resume by power button OK.
- After resuming, power and brightness up/down buttons are working normally.
- Previously on KDE Plasma/Xorg, no issue at all.

$ journalctl -u systemd-logind.service -b
-- Logs begin at Fri 2020-03-20 13:02:53 KST, end at Fri 2020-03-20 13:08:20 KST. --
-- No entries --


$ systemctl suspend

[ suspend OK then resume by power button]

$ journalctl -u systemd-logind.service -b
-- Logs begin at Fri 2020-03-20 13:02:53 KST, end at Fri 2020-03-20 13:08:59 KST. --
 3월 20 13:08:53 a systemd-logind[911]: Operation 'sleep' finished.


$ journalctl -u systemd-logind.service -b -f
-- Logs begin at Fri 2020-03-20 13:02:53 KST. --
 3월 20 13:08:53 a systemd-logind[911]: Operation 'sleep' finished.

$ 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=root
#InhibitDelayMaxSec=5

HandlePowerKey=suspend
HandleSuspendKey=suspend
HandleHibernateKey=suspend

#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

$ systemctl status systemd-logind.service

● systemd-logind.service - Login Service
     Loaded: loaded (/usr/lib/systemd/system/systemd-logind.service; static; vendor preset: disabled)
     Active: active (running) since Fri 2020-03-20 13:01:48 KST; 17min ago
       Docs: man:systemd-logind.service(8)
             man:logind.conf(5)
             https://www.freedesktop.org/wiki/Software/systemd/logind
             https://www.freedesktop.org/wiki/Software/systemd/multiseat
   Main PID: 911 (systemd-logind)
     Status: "Processing requests..."
      Tasks: 1 (limit: 19012)
     Memory: 5.0M
     CGroup: /system.slice/systemd-logind.service
             └─911 /usr/lib/systemd/systemd-logind

 3월 20 13:08:53 a systemd-logind[911]: Operation 'sleep' finished.
Warning: journal has been rotated since unit was started, output may be incomplete.

This config has no effect.

$ cat /etc/X11/Xwrapper.config
allowed_users=anybody
needs_root_rights=yes

Last edited by YCH (2020-03-20 04:32:25)


YCH

Offline

Board footer

Powered by FluxBB