【Linux】reboot,shutdown -r ,init 6失效问题处理分析

reboot失效问题处理

遇到一个问题

环境:虚拟机

现象rebootinit 6shutdown -r 命令都失效,没有任何回显,不执行重启操作,看命令的状态是执行成功。

使用reboot -f 直接命令卡死,等待3秒无果后,手动ctrl+c 中断命令。依然无法重启。

查看messagesyslogkerl.log等日志没有任何重启记录。

唯一有突破口的是有journal日志。

查看journal日志,定位问题发生时间点。

查看问题状态为。

923 09:22:40 systemd[1]: session-19.scope: Stopping timed out. Killing.
923 09:22:40 systemd[1]: session-19.scope: Killing process 10519 (vim) with signal SIGKILL.
923 09:22:40 systemd[1]: session-6.scope: Stopping timed out. Killing.
923 09:22:40 systemd[1]: session-6.scope: Killing process 12130 (mysqld) with signal SIGKILL.
923 09:22:40 systemd[1]: session-6.scope: Killing process 21921 (mysqld) with signal SIGKILL.
923 09:22:40 systemd[1]: session-6.scope: Killing process 10979 (mysqld) with signal SIGKILL.
923 09:22:40 systemd[1]: session-6.scope: Killing process 13534 (mysqld) with signal SIGKILL.
923 09:22:40 systemd[1]: session-6.scope: Killing process 17494 (mysqld) with signal SIGKILL.
923 09:22:40 systemd[1]: session-16.scope: Stopping timed out. Killing.
923 09:22:40 systemd[1]: session-16.scope: Killing process 14451 (vim) with signal SIGKILL.
923 09:22:40 systemd[1]: session-17.scope: Stopping timed out. Killing.
923 09:22:40 systemd[1]: session-17.scope: Killing process 21253 (sudo) with signal SIGKILL.
923 09:22:40 systemd[1]: session-17.scope: Killing process 21254 (nginx) with signal SIGKILL.
923 09:22:40 systemd[1]: session-14.scope: Stopping timed out. Killing.
923 09:22:40 systemd[1]: session-14.scope: Killing process 6504 (mysqld) with signal SIGKILL.
923 09:22:51 systemd[1]: logrotate.service: State 'stop-sigterm' timed out. Killing.
923 09:22:51 systemd[1]: logrotate.service: Killing process 1794 (logrotate) with signal SIGKILL.
923 09:22:51 systemd[1]: session-7.scope: Stopping timed out. Killing.
923 09:22:51 systemd[1]: session-7.scope: Killing process 14340 (xxxx) with signal SIGKILL.
923 09:22:51 systemd[1]: session-7.scope: Killing process 17572 (xxxx) with signal SIGKILL.
923 09:22:51 systemd[1]: session-8.scope: Still around after SIGKILL. Ignoring.
923 09:22:51 systemd[1]: session-8.scope: Failed with result 'timeout'.
923 09:22:51 systemd[1]: Stopped Session 8 of user xxxx.
923 09:22:51 systemd[1]: session-4.scope: Still around after SIGKILL. Ignoring.
923 09:22:51 systemd[1]: session-4.scope: Failed with result 'timeout'.
923 09:22:51 systemd[1]: Stopped Session 4 of user xxxx.
923 09:22:51 systemd[1]: logrotate.service: Processes still around after SIGKILL. Ignoring.
923 09:22:51 systemd[1]: session-12.scope: Still around after SIGKILL. Ignoring.
923 09:22:51 systemd[1]: session-12.scope: Failed with result 'timeout'.
923 09:22:51 systemd[1]: Stopped Session 12 of user xxxx.
923 09:22:51 systemd[1]: session-14.scope: Still around after SIGKILL. Ignoring.
923 09:22:51 systemd[1]: session-14.scope: Failed with result 'timeout'.
923 09:22:51 systemd[1]: Stopped Session 14 of user xxxx.
923 09:22:51 systemd[1]: session-10.scope: Still around after SIGKILL. Ignoring.
923 09:22:51 systemd[1]: session-10.scope: Failed with result 'timeout'.
923 09:22:51 systemd[1]: Stopped Session 10 of user xxxx.
923 09:22:51 systemd[1]: session-19.scope: Still around after SIGKILL. Ignoring.
923 09:22:51 systemd[1]: session-19.scope: Failed with result 'timeout'.
923 09:22:51 systemd[1]: Stopped Session 19 of user xxxx.
923 09:22:51 systemd[1]: session-6.scope: Still around after SIGKILL. Ignoring.
923 09:22:51 systemd[1]: session-6.scope: Failed with result 'timeout'.
923 09:22:51 systemd[1]: Stopped Session 6 of user xxxx.
923 09:22:51 systemd[1]: session-16.scope: Still around after SIGKILL. Ignoring.

进程systemd很多被kill了,但未报出OOM等日志信息。

问题分析:

猜想1:应该是某个进程占用资源过高,cpu,内存,或io,持续不释放,dbus进程也出现异常。

猜想2:其中占用资源高的进程,io资源持续不释放,导致无法写入其他systemd,现象不是不执行,可能需要等待很久,需要等待占用磁盘过高的进程脏数据写入完成,资源释放之后,会重启成功,但这个猜想成功率不大。

猜想3:执行完成确实是资源被占用,时间很长后,触发timeout ,命令失效导致。

综上3个猜想,但基本可以确定,资源已经占用过高,先处理进程问题。确认进程是否正常。或手动kill占用过高进程,释放资源后,执行reboot,确认是否成功。

原文链接:https://blog.csdn.net/imliuqun123/article/details/127392025

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值