我遇到了盖子闭合暂停的问题,它不再与 i3wm 一起工作(与 xfce 一起工作)。 systemd 登录服务正在运行,并且还检测到盖子关闭和打开事件,但随后行为不符合配置。
这里是服务的 systemd 状态:
● systemd-logind.service - User Login Management
Loaded: loaded (/usr/lib/systemd/system/systemd-logind.service; static)
Active: active (running) since Mon 2021-08-23 21:28:29 CEST; 8min ago
Docs: man:sd-login(3)
man:systemd-logind.service(8)
man:logind.conf(5)
man:org.freedesktop.login1(5)
Main PID: 8998 (systemd-logind)
Status: "Processing requests..."
Tasks: 1 (limit: 16617)
Memory: 1.3M
CPU: 111ms
CGroup: /system.slice/systemd-logind.service
└─8998 /usr/lib/systemd/systemd-logind
Aug 23 21:28:29 MaxT495 systemd-logind[8998]: Watching system buttons on /dev/input/event2 (Sleep Button)
Aug 23 21:28:29 MaxT495 systemd-logind[8998]: Watching system buttons on /dev/input/event4 (AT Translated Set 2 keyboard)
Aug 23 21:28:29 MaxT495 systemd-logind[8998]: Watching system buttons on /dev/input/event7 (ThinkPad Extra Buttons)
Aug 23 21:28:29 MaxT495 systemd[1]: Started User Login Management.
Aug 23 21:28:29 MaxT495 systemd-logind[8998]: New session 2 of user max.
Aug 23 21:28:33 MaxT495 systemd-logind[8998]: Lid closed.
Aug 23 21:28:41 MaxT495 systemd-logind[8998]: Lid opened.
Aug 23 21:29:06 MaxT495 systemd-logind[8998]: Power key pressed.
Aug 23 21:31:19 MaxT495 systemd-logind[8998]: Lid closed.
Aug 23 21:31:26 MaxT495 systemd-logind[8998]: Lid opened.
这里是登录配置文件的重要部分:输出cat /etc/systemd/logind.conf | grep "#" -v
:
[Login]
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
SuspendKeyIgnoreInhibited=yes
LidSwitchIgnoreInhibited=yes
因此,如 systemd 服务状态中所述,检测到盖子关闭事件,但我的笔记本电脑没有暂停! :(
有人能帮助我吗?
附加信息:
systemctl suspend
有效!
答案1
如果有人遇到同样的问题,请执行:
$ systemd-inhibit --list --mode=block
检查是否有其他服务阻止系统操作。