│ │ └─pstree │ └─sshd───bash ├─systemd-journal ├─systemd-logind 6204) │ └─sshd(5546)───bash(5548) ├─systemd-journal(484) ├─systemd-logind │ │ ├─more │ │ └─pstree -a │ └─sshd │ └─bash ├─systemd-journal ├─systemd-logind systemd(1)-+-NetworkManager(634)-+-{NetworkManager}(656) |-systemd-journal(484) |-systemd-logind
发现是systemd-logind的问题,结合top查看 ? systemd-logind占用CPU100%,导致系统负载飙升 ? systemd-logind是什么呢? systemd-logind 是一个管理用户登录的系统服务。其职责如下: 持续跟踪用户的会话、进程、空闲状态。 在用户登录时的调用 首先查看下systemd-logind的pid ? 发现除了用户登录,还有大量的crond定时任务的session,可以看到每个session下面的详细命令或脚本 systemd-logind有个bug,就是当有crond时,往往session回收不及时 至此问题大致了解,systemd-logind在用户登录时申请资源,由于系统资源不够,导致无法创建session,无法登录。
经实验,发现使用yum升级两个软件包之后,systemd-logind的可执行文件也被更新,导致该服务处于原可执行文件已删除的状态,所以我提议,在升级步骤中增加重启systemd-logind服务的动作 先关闭systemd-logind服务。使用命令strace -ff -s 1000 -p 1挂在systemd主进程上做跟踪,并用-o参数把多个进程的跟踪记录分别写在文件里。 然后启动systemd-logind服务。这样,strace可以跟踪到 1号进程clone+execv执行systemd-logind的瞬间,以及systemd-login最开头的行为。 清理之后再重启systemd-logind服务,恢复正常。 所以我认为session残留其实是个旧数据累积导致的systemd-logind的性能雪崩问题。
failure occurred at: sskgpwwait1 数据库版本11.2.0.4,操作系统版本:rhel 7 检查操作系统日志,定时任务日志并无异常; 原因: On RedHat 7.x, systemd-logind 在 RHEL 7.x的版本里,systemd-logind 服务控制着用户的行为,当用户退出,会清理该用户的所有内存段.那么定时任务的数据泵就有问题了,调用的内存段是oracle的; 查看removeipc 1) Set RemoveIPC=no in /etc/systemd/logind.conf 2) 重启服务 systemctl daemon-reload systemctl restart systemd-logind
Database - Standard Edition Oracle Database - Enterprise Edition Linux x86-64 Linux x86 描述: 在RHEL7.2中,systemd-logind systemd-logind remove掉IPC objects可能在任何时候发生,故障的表现可以有很大的不同,下面是故障的几个例子 view pl co Most common error that ef57000] 变通的解决方法: 1) Set RemoveIPC=no in /etc/systemd/logind.conf 2) Reboot the server or restart systemd-logind as follows: # systemctl daemon-reload # systemctl restart systemd-logind 补丁: 从RHEL7.2迁移到Oracle
create session: Failed to activate service 'org.freedesktop.login1': timed out以上报错的信息大致意思如下:dbus的服务重启后,systemd-logind 服务没有重启导致,可以查看systemctl status systemd-logind的状态,解决方法就是重启该服务 systemctl restart systemd-logind重启systemd-logind 服务后,发现ssh可以秒连接了总结:重启systemd-logind服务即可systemctl restart systemd-logind
# 二、修改下述内容 将内容: #HandleLidSwitch=suspend 修改为:(别忘了去掉 # ) HandleLidSwitch=ignore # 三、重启服务 service systemd-logind
这篇文章中找到了答案: https://blog.csdn.net/littleRpl/article/details/110119384 结果就是说systemd-logind 这个服务有问题,需要重启一下 : systemctl restart systemd-logind 重启后再次验证,发现FinalShell也连接上了。
─sshd─┬─bash───pstree │ └─bash───man───less ├─systemd-journal ├─systemd-logind -a │ └─bash │ └─man pstree │ └─less -s ├─systemd-journal ├─systemd-logind
sshd───sshd─┬─bash───bash───pstree │ └─bash ├─systemd-journal ├─systemd-logind ├─sshd───sshd─┬─bash───pstree │ └─bash ├─systemd-journal ├─systemd-logind
4️⃣ 重启电源管理服务最后一步,让配置生效:systemctl restart systemd-logind三、验证结果现在你可以放心地:✅ 合上笔记本盖子✅ fnOS 继续运行✅ NAS 服务不断✅
| sort | uniq -c | sort -rn | head -100 这里可以看出是哪里出现了问题,我们的是由于CROND导致,所以解决办法是: 1 systemctl restart systemd-logind
启动用户登录管理程序:用户登录管理程序(如getty和systemd-logind)负责管理用户登录和会话。当用户输入用户名和密码后,登录管理程序会验证用户身份并启动相应的会话。
8744 0.88 NetworkManager 09:54:32 AM 0 635 0.02 0.00 26384 1792 0.18 systemd-logind 0.11 0.00 0.00 NetworkManager 09:56:29 AM 0 635 0.01 0.00 0.00 systemd-logind
rsyslogd}] ├─sshd -D │ └─sshd │ └─bash │ └─pstree -a ├─systemd-journal ├─systemd-logind
└─sshd─┬─bash───pstree │ └─sftp-server ├─systemd-journal ├─systemd-logind
sftp-server │ └─sshd─┬─bash───pstree │ └─sftp-server ├─systemd-journal ├─systemd-logind
RemoveIPC=yes 一、将/etc/systemd/logind.conf里的RemoveIPC修改为no RemoveIPC=no 二、重启system-login服务 systemctl restart systemd-logind
sshd───sshd─┬─bash───bash───pstree │ └─bash ├─systemd-journal ├─systemd-logind
└─sshd─┬─bash───pstree │ └─sftp-server ├─systemd-journal ├─systemd-logind