![如何在 ubuntu 16.04 系统中查找系统重启或关机的原因?](https://linux22.com/image/713849/%E5%A6%82%E4%BD%95%E5%9C%A8%20ubuntu%2016.04%20%E7%B3%BB%E7%BB%9F%E4%B8%AD%E6%9F%A5%E6%89%BE%E7%B3%BB%E7%BB%9F%E9%87%8D%E5%90%AF%E6%88%96%E5%85%B3%E6%9C%BA%E7%9A%84%E5%8E%9F%E5%9B%A0%EF%BC%9F.png)
我的 ubuntu 16.04 服务器偶尔会自行重启,但我不知道为什么?以下是 syslog 文件内容,其中包含名为 Shutdown 的关键字
Nov 21 13:51:42 AB-active-server systemd[1]: Created slice User Slice of support.
Nov 21 13:51:42 AB-active-server systemd[1]: Starting User Manager for UID 1000...
Nov 21 13:51:42 AB-active-server systemd[1]: Started Session 1196 of user support.
Nov 21 13:51:42 AB-active-server systemd[18340]: Reached target Sockets.
Nov 21 13:51:42 AB-active-server systemd[18340]: Reached target Paths.
Nov 21 13:51:42 AB-active-server systemd[18340]: Reached target Timers.
Nov 21 13:51:42 AB-active-server systemd[18340]: Reached target Basic System.
Nov 21 13:51:42 AB-active-server systemd[18340]: Reached target Default.
Nov 21 13:51:42 AB-active-server systemd[18340]: Startup finished in 15ms.
Nov 21 13:51:42 AB-active-server systemd[1]: Started User Manager for UID 1000.
Nov 21 13:51:42 AB-active-server console-kit-daemon[21735]: (process:18348): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Nov 21 13:51:42 AB-active-server console-kit-daemon[21735]: missing action
Nov 21 13:51:44 AB-active-server systemd[1]: Stopping User Manager for UID 1000...
Nov 21 13:51:44 AB-active-server systemd[18340]: Stopped target Default.
Nov 21 13:51:44 AB-active-server systemd[18340]: Reached target Shutdown.
Nov 21 13:51:44 AB-active-server console-kit-daemon[21735]: (process:18386): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Nov 21 13:51:44 AB-active-server console-kit-daemon[21735]: missing action
Nov 21 13:51:44 AB-active-server console-kit-daemon[21735]: console-kit-daemon[21735]: GLib-CRITICAL: Source ID 739 was not found when attempting to remove it
Nov 21 13:51:44 AB-active-server systemd[18340]: Starting Exit the Session...
Nov 21 13:51:44 AB-active-server console-kit-daemon[21735]: GLib-CRITICAL: Source ID 739 was not found when attempting to remove it
Nov 21 13:51:44 AB-active-server systemd[18340]: Stopped target Basic System.
Nov 21 13:51:44 AB-active-server systemd[18340]: Stopped target Timers.
Nov 21 13:51:44 AB-active-server systemd[18340]: Stopped target Sockets.
Nov 21 13:51:44 AB-active-server systemd[18340]: Stopped target Paths.
Nov 21 13:51:44 AB-active-server systemd[18340]: Received SIGRTMIN+24 from PID 18387 (kill).
Nov 21 13:51:44 AB-active-server systemd[1]: Stopped User Manager for UID 1000.
Nov 21 13:51:44 AB-active-server systemd[1]: Removed slice User Slice of support.
服务器的磁盘分区有 60% 以上的可用存储空间,并且 inode 的使用率仅为 1%
内存为 60G,英特尔 Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz
答案1
如果发生无法解释的关机,我会查看所有日志,这可能是找出问题的唯一机会。我会查看系统日志,找到启动的位置,然后查看之前的条目。
有时没有确凿的证据,那么你可以询问你的 DC 是否发生过电源事件并检查他们的设备。我最近有一台服务器意外离线了几次,结果发现是机架 PDU 出现故障。