Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My pc with ubuntu server 12.10 installed on it shutdowns itself. How can i find the reason? I think that it is not depend on hardware.

any help will be appreciated

share|improve this question
this would be better suited to, I think – evilsoup Jan 7 '13 at 17:06

The most common reason for this behavior is over-heating. Is this a laptop? Can you feel the machine heating up before it shuts down?

Relevant log files should be in /var/log, specifically, have a look at /var/log/messages and maybe /var/log/pm-powersave.log and /var/log/pm-suspend.log.

share|improve this answer

This answer, with optional (but important in case of overheating) shutdown -r $1 after the echo:

The way I'd track this down is to replace the utilities halt and shutdown with a script.

First create a script such as the following at /bin/fakehalt:

exec >>/tmp/fakehalt.log 2>&1
echo "CMD=$0 PID=$$"
ps -ef --forest
echo '========'

Then install it with:

chmod a+x /bin/fakehalt
mv /sbin/halt /sbin/halt.orig
ln -s /bin/fakehalt /sbin/halt
mv /sbin/shutdown /sbin/shutdown.orig
ln -s /bin/fakehalt /sbin/shutdown

This will create a log file at /tmp/fakehalt.log each time it is called. It'll log the name it was called as (halt or shutdown) it's own PID, and then a tree diagram of all processes at the time.

This should give you all the necessary info to track it down. Just look through the ps tree and find what called the script.

/sbin/reboot should be a symlink to /sbin/halt. If it isn't, then replace it as well.

If this still doesn't capture it, replace /sbin/init as well (as it can also be used to reboot the system). But this is dangerous as if the system reboots, it won't come up properly.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .