Interview Prep/Linux/Boot, time, cron and kernel

A server rebooted unexpectedly overnight. How do you find out why?

IntermediateTroubleshootingBoot, time, cron and kernel
Answer

Likely causes → Kernel panic, OOM-induced watchdog, hardware fault, power loss, a scheduled automatic update reboot, or someone ran reboot.

Diagnose →

last -x | grep -E 'reboot|shutdown' | head
journalctl --list-boots
journalctl -b -1 -e                         # end of the previous boot
journalctl -b -1 | grep -Ei 'panic|watchdog|oom|reboot|shutdown'
ls /var/crash/ 2>/dev/null

Check the cloud provider's events and hardware logs (ipmitool sel list).

Fix → Depends on the cause found: clean shutdown messages point to a person or automation; an abrupt end of logs points to panic, power or hardware.

Prevent → Persistent journal, kdump, and monitoring of hardware events.

All Linux questions Roadmap: Linux

More on Boot, time, cron and kernel