Unexpected Shutdown - Where to look for clues

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Imposter

Unexpected Shutdown - Where to look for clues

Post by Imposter »

Occasionally Mint shutdowns on me when I'm not there. I often leave the computer on, sometimes for days without problems. Then once or twice I've found that it's shutdown on its own. I'm wondering if there are any logs or messages that could point to a reason why it would shutdown?

As a newbie I'd appreciate any clues or pointers of which commands to use; where to look; and maybe what to look for.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
gm10

Re: Unexpected Shutdown - Where to look for clues

Post by gm10 »

I take it you ruled out power manager settings that would sleep or hibernate the computer. There's also appllications like e.g. download managers that come with options to shut down your computer once scheduled operations are completed.

Otherwise run last shutdown -x | more to find out when the device shut down exactly while you weren't there, then you can check the logs from that time to see what was happening. /var/log/syslog or /var/log/kern.log might have some information (there's a log file viewer available in the menu, too).

Note that if you don't find the relevant shutdown times via the last command then that means your system didn't cleanly shut down. Possible reasons are a power outage, a BIOS/UEFI triggered emergency shutdown due to overheating, things like that.
Imposter

Re: Unexpected Shutdown - Where to look for clues

Post by Imposter »

Thanks for the pointers.

I've checked with the last command and the dates/times don't seem consistent with when I noticed it down.

When I rebooted it goes through a fsck so I think it's not a hibernation think... but I hadn't thought of that and will double check.

Nothing I can see in the logfiles. Is it likely to lose logfile data in the event of fault/crash?
gm10

Re: Unexpected Shutdown - Where to look for clues

Post by gm10 »

Imposter wrote: Thu Jul 19, 2018 4:38 pm Thanks for the pointers.

I've checked with the last command and the dates/times don't seem consistent with when I noticed it down.

When I rebooted it goes through a fsck so I think it's not a hibernation think... but I hadn't thought of that and will double check.

Nothing I can see in the logfiles. Is it likely to lose logfile data in the event of fault/crash?
Hibernation can fail to resume in which case it may look like a regular shutdown. var/log/pm-suspend.log should have information if hibernation was attempted.

It's unlikely that the system crashes to a point where log files are lost, but not impossible. /var/log/apport.log might have info about application crashes.

The most important log I forgot to mention actually, try journalctl -e (add the -u parameter to speciify a cut-off date/time), that one aggregates info from other logs as well as from systemd, it's your best bet at finding what initiated the shutdown.
Mute Ant

Re: Unexpected Shutdown - Where to look for clues

Post by Mute Ant »

"...likely to lose logfile data in the event of fault/crash?..." Yes, if it's a hardware fault. The OS is given no message and no time to act, the power-supply just shuts off. Running the memory-test from a Live Session Mint or the GRUB menu will test a lot of the motherboard silicon and encourage the CPU to overheat, if that's part of the problem.
Imposter

Re: Unexpected Shutdown - Where to look for clues

Post by Imposter »

Thanks for the suggestions so far. Very useful and informative.

In the various logfiles I can see some indication of SMART errors. Googling suggests that these could be false alarms or warnings. I'll keep monitoring and looking periodically. The system has been up and running for 24hrs now without a failure.

Hardware failure seems the most likely if the system comes to power-off state. I try performing the more low level tests to see if I can make it happen.

Thanks so far
gm10

Re: Unexpected Shutdown - Where to look for clues

Post by gm10 »

Imposter wrote: Fri Jul 20, 2018 7:22 am In the various logfiles I can see some indication of SMART errors. Googling suggests that these could be false alarms or warnings. I'll keep monitoring and looking periodically. The system has been up and running for 24hrs now without a failure.
In the Disks tool that you find on the menu, select the disk and then click the hamburger button to find SMART data and tests. Check the values if anything stands out as problematic and run a self-test. It could be that your hard drive is failing.
Imposter wrote: Fri Jul 20, 2018 7:22 am Hardware failure seems the most likely if the system comes to power-off state. I try performing the more low level tests to see if I can make it happen.
It's possible but we already established that your system was shut down orderly, you've got the shutdown times logged. Unless you've got the system configured to reboot upon kernel panic I guess. That's not the default setting though.
Imposter

Re: Unexpected Shutdown - Where to look for clues

Post by Imposter »

gm10 wrote: Fri Jul 20, 2018 7:44 am It's possible but we already established that your system was shut down orderly, you've got the shutdown times logged. Unless you've got the system configured to reboot upon kernel panic I guess. That's not the default setting though.
No, the last command didn't give times that matched when the system mysteriously went down. Chkd is also running during the mint startup, when the dots are on the screen. At this stage I'm thinking that it isn't shutting down normally when this happens.

One disk does show one attribute failed in the past. The physical disk is not part of the system root filesystem, but is entirely part of a LVM mapped to /home for user data. As a newbie I wouldn't expect a disk fault to put the system into a powerdown state.

I'll keep checking disks and logfiles. It's been back up for nearly 24hrs now, and I'll leave it running until it crashes again or I need to shutdown for some other reasons. This isn't a frequent problem, it's often on working for days on end. I've noticed perhaps 3 unexpected shutdowns though. First couple of times I wasn't sure if it was something that I did. This time I'm sure I didn't power it down or there wasn't a power interruption. Hence, I'm now curious and looking for possible causes or things to check.
gm10

Re: Unexpected Shutdown - Where to look for clues

Post by gm10 »

Oh, my bad, you are correct, I had initially misread that.

If we now think it's hardware related then it could also be due to driver/kernel issues. Look carefully through dmesg/kern.log.
Imposter

Re: Unexpected Shutdown - Where to look for clues

Post by Imposter »

everything's pointing to a failing hard drive. Lots of SMART errors logged. Although I'm not quite sure why that should cause the system to powerdown!

Thanks for the tips of where and how to look for information.
oldgranola
Level 5
Level 5
Posts: 564
Joined: Fri Sep 05, 2014 1:39 am

Re: Unexpected Shutdown - Where to look for clues

Post by oldgranola »

One more. I visited some web sites that after a time, not right away, suddenly really pushed my cpu and gpu. While doing nothing but streaming I could hear the fans going crazy. The bios would shut it down do to overtemp. Crypto mining......
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob
Locked

Return to “Beginner Questions”