Some mornings I wake up to find that my computer has rebooted for reasons unknown to me. I've tried looking in various files in Log File Viewer, but none seems to provide any clues.

What can I do to investigate what's going on?

edit: This is not a power outage/surge. I'm hooked up to a UPS battery, and the logs always show that reboot happens within a minute or two of the crash.

  • 2
    Please look at (or let us look at :) dmesg (or dmesg*.tar.gz), /var/log/kern.log and /var/log/syslog
    – ish
    Jul 21 '12 at 14:14
  • The last many lines in dmesg/kern.log/syslog when this happens are, to my recollection, almost always just UFW log entries (and today they are too).
    – Jay
    Jul 21 '12 at 14:39

A few questions:

  • Does it reboot at roughly the same time of day?
  • Are you running automated updates? (You should be.)
  • Have you enabled automated updates to reboot the system?

If so your system is not crashing, it is rebooting to install an update that requires a reboot. On Linux/Unix, this is generally a kernel update. On Windows, it could be pretty well anything that can't be unloaded without a reboot.

I have noticed a relatively high rate of kernel updates recently. Good news is bugs are being found and fixed. Bad news, is a reboot is required.

On my system automatic reboots are controlled in the file /etc/apt/apt.conf.d/50unattended-upgrades. The line that controls it begins Unattended-Upgrade::Automatic-Reboot and take a true or false value. If you don't allow automatic reboots, you should be notified that a reboot is required when you login.

EDIT: There are other packages besides unattended-upgrades. Some of them may trigger a reboot. They should all invoke apt to do the upgrade. Check /var/log/apt/history.log to see if updates are occurring before the reboot.

If the reboots are occurring at roughly the same time, then there may be something in the crontabs that is causing the reboots.

If the system really is crashing, it may be the BIOS which is rebooting the system. You may want to change the power on state setting.

  • That line in 50unattended-upgrades is commented out, and "Software Sources" is set only to "Display immediately" security updates. And come to think of it, I think around midnight is a common time for this to happen. It's usually in the middle of the night, anyway -- more rarely (if at all) when I'm just out of the house during the day (and I think never when I'm actively doing things on it).
    – Jay
    Jul 21 '12 at 15:46
  • Thanks BillThor -- Nothing in /var/log/apt/history.log. Will have to check cron and BIOS settings.
    – Jay
    Jul 23 '12 at 11:36

I had some hardware problems earlier, and whenever my system crashed, it would not reboot. As a result, I think that when Ubuntu gets a kernel panic, it won't reboot, but will instead flash the caps lock light and display the same thing that it did when it crashed. As per BillThor's suggestion, that makes it seem like an automatically configured reboot rather than a crash.

Not the answer you're looking for? Browse other questions tagged or ask your own question.