systemd logind 禁用自动休眠

我在 一台笔记本装了ubuntu,但是这个崽子,当我过几十分钟没用它,就发现它自动休眠了。。

当按照网上的教程禁用休眠,又发现一个叫systemd-logind的进程,疯狂吃我cpu资源,看日志,大量的

May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied
May 11 14:07:29 wsk systemd-logind[703]: Failed to execute suspend operation: Permission denied

我有点慌,这崽子在做什么飞机。

然后网上搜索教程,找到了说明,说你得配置logind,让它不要乱来。好的。现在就干活。

然后我编辑了/etc/systemd/logind.conf

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
HandleRebootKey=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodesMax=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

重启系统,整个世界安静了。也不自动关机了,也不乱吃我cpu了。

 

分类: 默认 标签: 发布于: 2022-05-11 18:32:04, 更新于: 2022-05-11 18:32:04