A Thinkpad X220 (Core-i5, SandyBridge, Intel GMA) running Precise 64-bit has rebooted hard twice in the last four days. I was doing nothing more than writing an email. No warning. It just went black, and the next thing I saw was the Lenovo boot screen.
Where should I look to find the cause? I fear that this immediate reboot does not leave time for logs to be written...
Thanks!
Check
/proc/sys/kernel/panic
; if its value is 1 then the server will immediately reboot on panic. Buggy drivers can cause a kernel panic.If it's not a panic check last issue of reboot, maybe overheating is the issue.
Commands
dmesg
- May not show items from before last boot, but very useful if the system is still upFiles
/var/log/syslog
- System wide logger, usetail /var/log/syslog
orless /var/log/syslog
/var/log/kern.log
- Kernel log, same as above/var/log/*
TL;DR: @insider's answer, along with the comments by @Antonios Hadjigeorgalis led me to find that I had
in
I was experiencing sudden reboots, mostly soon after turning my laptop on in the morning. I'm running Ubuntu 18.04. Running
last reboot
showed that the kernel version was usually newer after the sudden reboots:Looking into
/etc/apt/apt.conf.d/50unattended-upgrades
, I saw that"Unattended-Upgrade::Automatic-Reboot"
was commented out, and its default is supposedly false. I then ran the following:And there was my problem -
Unattended-Upgrade::Automatic-Reboot "true";
in/etc/apt/apt.conf.d/99custom-unattended-upgrades
.Application crashes have crash files in
/var/crash/
; I'd also explore normal system logs which are your best bet. If the hardware shutdown you won't see anything in the systemd & message logs (a HUGE clue!!). If Ubuntu was aware of shutdown you'll see that too as you'll see reasons for shutdown. (If no details are found you'll need to check machine logs; ie. HOST OS if VM or hardware logs if on metal)To look at app crashes on this box
Starting with application crashes is easy, so I'd look there first, however I can't really think of why a application crash could cause a reboot or shutdown; so I'd not expect to see anything meaningful there (if it's useful; it'll be after system logs).
To view system messages (for current session) you can use
dmesg
. Because it'll show the current session only, you won't see a reason for the last shutdown (that was last session), but after an unclean shutdown I'd expect to see results of afsck
(because of unplanned shutdown).The best clues however are in systemd journals, or
journalctl
. This is where I'd really look for clues on last shutdown, ie. it's here where I'd expect to see the lack of normal shutdown messages which means it's a clue of hardware shutdown (eg. cpu shutoff because of extreme heat threshold; a pin gets grounded with OS having no clue so messages just stop! and next message is normal booting of next session; such messages will be found in hardware logs assuming an enterprise server; consumer grade usually don't keep hardware logs).Sometimes you can see clues of overheating in logs anyway; bad if the PSU has issues (PWR_GOOD drops) nothing will be found as CPU wasn't even aware of shutdown; I suspect hardware logs may miss this type of shutdown too (but lack of entries is still a clue!)
To further narrow down where to look though, will depend on what type of server, what is running on it, and details that haven't been provided.