systemd-logind.service系统占用率高该如何解决

最大的社区版本,Ubuntu的发源地
回复
mercelproust
帖子: 1
注册时间: 2021-06-04 16:36
系统: debian10

systemd-logind.service系统占用率高该如何解决

#1

帖子 mercelproust » 2021-06-04 16:41

我当前使用的debian10的系统,看到系统内systemd-logind.service服务占用的cpu和硬盘资源都很高,查看服务状态,好像是有权限不够,导致一直在输出日志内容的感觉,需要如何设置将systemd-logind.service服务权限提升或者彻底禁用该服务?

我尝试使用systemctl stop systemd-logind.service 和systemctl disable systemd-logind.service禁用服务,不过我ssh远程登录后,服务还是会起来
系统内看到的日志如下:

(base) proust@debian:~$ sudo systemctl status systemd-logind.service
● systemd-logind.service - Login Service
Loaded: loaded (/lib/systemd/system/systemd-logind.service; static; vendor preset: enabled)
Active: active (running) since Fri 2021-06-04 14:54:35 CST; 1h 30min ago
Docs: man:systemd-logind.service(8)
man:logind.conf(5)
https://www.freedesktop.org/wiki/Softwa ... emd/logind
https://www.freedesktop.org/wiki/Softwa ... /multiseat
Main PID: 5137 (systemd-logind)
Status: "Processing requests..."
Tasks: 1 (limit: 4637)
Memory: 2.0M
CGroup: /system.slice/systemd-logind.service
└─5137 /lib/systemd/systemd-logind

6月 04 16:25:15 debian systemd-logind[5137]: Failed to execute operation: Permission denied
6月 04 16:25:15 debian systemd-logind[5137]: Suspending...
6月 04 16:25:15 debian systemd-logind[5137]: Unit suspend.target is masked, refusing operation.
6月 04 16:25:15 debian systemd-logind[5137]: Failed to execute operation: Permission denied
6月 04 16:25:15 debian systemd-logind[5137]: Suspending...
6月 04 16:25:15 debian systemd-logind[5137]: Unit suspend.target is masked, refusing operation.
6月 04 16:25:15 debian systemd-logind[5137]: Failed to execute operation: Permission denied
6月 04 16:25:15 debian systemd-logind[5137]: Suspending...
6月 04 16:25:15 debian systemd-logind[5137]: Unit suspend.target is masked, refusing operation.
6月 04 16:25:15 debian systemd-logind[5137]: Failed to execute operation: Permission denied
头像
astolia
论坛版主
帖子: 6450
注册时间: 2008-09-18 13:11

Re: systemd-logind.service系统占用率高该如何解决

#2

帖子 astolia » 2021-06-05 18:38

这不写得很明白吗?有东西一直在尝试把你的系统切换到挂起状态,但当前suspend.target被mask也就是被彻底禁用了,无法切换。
我不知道你的系统是怎么被搞成这样的,要取消suspend.target的mask状态,执行sudo systemctl unmask suspend.target。
另外建议你用man systemd-logind.service看看systemd-logind.service的职责,再决定要不要禁用它
回复