![笔记本电脑经常挂起](https://linux22.com/image/194800/%E7%AC%94%E8%AE%B0%E6%9C%AC%E7%94%B5%E8%84%91%E7%BB%8F%E5%B8%B8%E6%8C%82%E8%B5%B7.png)
我在使用新的 Debian 11 笔记本电脑时遇到问题,有时它工作正常,但有时它会在启动约 30 秒后反复进入睡眠状态。
stew@simswe28:~$ sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target
● sleep.target - Sleep
Loaded: loaded (/lib/systemd/system/sleep.target; static)
Active: inactive (dead)
Docs: man:systemd.special(7)
Aug 24 08:18:36 simswe28 systemd[1]: Reached target Sleep.
Aug 24 08:18:46 simswe28 systemd[1]: Stopped target Sleep.
Aug 24 08:19:14 simswe28 systemd[1]: Reached target Sleep.
Aug 24 08:22:14 simswe28 systemd[1]: Stopped target Sleep.
Aug 24 08:22:42 simswe28 systemd[1]: Reached target Sleep.
Aug 24 08:25:40 simswe28 systemd[1]: Stopped target Sleep.
Aug 24 08:26:10 simswe28 systemd[1]: Reached target Sleep.
Aug 24 08:26:42 simswe28 systemd[1]: Stopped target Sleep.
Aug 24 08:27:10 simswe28 systemd[1]: Reached target Sleep.
Aug 24 08:27:19 simswe28 systemd[1]: Stopped target Sleep.
● suspend.target - Suspend
Loaded: loaded (/lib/systemd/system/suspend.target; static)
Active: inactive (dead)
Docs: man:systemd.special(7)
Aug 24 08:18:46 simswe28 systemd[1]: Reached target Suspend.
Aug 24 08:18:46 simswe28 systemd[1]: Stopped target Suspend.
Aug 24 08:22:14 simswe28 systemd[1]: Reached target Suspend.
Aug 24 08:22:14 simswe28 systemd[1]: Stopped target Suspend.
Aug 24 08:25:40 simswe28 systemd[1]: Reached target Suspend.
Aug 24 08:25:40 simswe28 systemd[1]: Stopped target Suspend.
Aug 24 08:26:42 simswe28 systemd[1]: Reached target Suspend.
Aug 24 08:26:42 simswe28 systemd[1]: Stopped target Suspend.
Aug 24 08:27:19 simswe28 systemd[1]: Reached target Suspend.
Aug 24 08:27:19 simswe28 systemd[1]: Stopped target Suspend.
● hibernate.target - Hibernate
Loaded: loaded (/lib/systemd/system/hibernate.target; static)
Active: inactive (dead)
Docs: man:systemd.special(7)
● hybrid-sleep.target - Hybrid Suspend+Hibernate
Loaded: loaded (/lib/systemd/system/hybrid-sleep.target; static)
Active: inactive (dead)
Docs: man:systemd.special(7)
我可以提供一些确认硬件问题或隔离配置问题的想法吗?试图筹集什么suspend.target
?
答案1
您可以使用 解决该问题sudo systemctl mask suspend.target
。这将阻止您的计算机不断挂起。然而,根本原因仍然存在。
达到稳定状态后,环顾四周找出是什么命令暂停。一种选择可能是电源按钮松动。通过运行确认acpi_listen
从包中acpid
。如果看到电源按钮事件,或者笔记本电脑盖子开关关闭,您将看到以下类型的消息:
~$ acpi_listen
button/power PBTN 00000080 00000000
button/power LNXPWRBN:00 00000080 00000001
button/lid LID open
button/lid LID close
button/lid LID open
如果它运行了一段时间没有消息,那么这不是你的问题。
如果您发现任何进程占用了大量资源,那么这些进程就值得检查。就我而言,我的粉丝声音很大,并注意到systemd-{logind,journal}
使用以下命令占用了大量资源top
:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
724 root 20 0 515012 8348 6880 R 87.5 0.1 7:15.06 systemd-logind
321 root 20 0 482776 306700 304868 S 12.5 1.9 0:55.29 systemd-journal
journalctl -f
将有助于隔离这些进程的原因。就我而言,这不断重复:
Aug 24 08:44:42 simswe28 systemd-logind[724]: Suspending...
Aug 24 08:44:42 simswe28 systemd-logind[724]: Unit suspend.target is masked, refusing operation.
Aug 24 08:44:42 simswe28 systemd-logind[724]: Failed to execute suspend operation: Permission denied
Aug 24 08:44:42 simswe28 systemd-logind[724]: Suspending...
Aug 24 08:44:42 simswe28 systemd-logind[724]: Unit suspend.target is masked, refusing operation.
Aug 24 08:44:42 simswe28 systemd-logind[724]: Failed to execute suspend operation: Permission denied
Aug 24 08:44:42 simswe28 systemd-logind[724]: Suspending...
Aug 24 08:44:42 simswe28 systemd-logind[724]: Unit suspend.target is masked, refusing operation.
Aug 24 08:44:42 simswe28 systemd-logind[724]: Failed to execute suspend operation: Permission denied
在这种情况下,systemd-logind
正在对某些信号做出反应。您可以通过隔离和抑制信号/etc/systemd/logind.conf
。
就我而言,我一次设置多个选项ignore
,然后systemctl unmask suspend.target && systemctl restart systemd-logind
。我发现更改HandleLidSwitch=
为suspend
解决ignore
了问题(即使acpi_listen
没有记录盖子开关事件)。
答案2
我的笔记本电脑曾经随机挂起,结果发现电池无法正常充电(充电器电缆损坏)。其他原因可能是过热(机器周围气流不足)。