I have a question about the best practice with a home linux box.

I recently install CentOS 5.6 on a machine I had lying around, and now I am using it by sshing into it from another machine. All that works fine, but the machine is turning off in the middle of the night. I think it is actually shutting down, or it could be sleeping, but when I push the power button, it boots afresh. I do not think this is a hardware issue.

I have tried two options:

  1. Logging in as root user to gnome and turning off all the power options. Screen saver, etc.

But if I just turn the monitor off and leave it on the desktop screen, the server eventually turns off.

  1. Leaving it on the initial login screen. This is the screen where you select kde, gnome, terminal, etc.

It also eventually turns off here too.

Thanks in advance for any advise as to how to prevent this. Again, I changed the gnome power settings to 'never' for everything but it does not seem to fix this issue.

  • I think this question belongs to Server Fault.
    – Crend King
    Apr 26, 2011 at 19:58

2 Answers 2


A strange CentOS behaviour indeed. Have you checked the logs? This should be the first step to investigate the problem. First, try syslog:

less /var/log/syslog

Then dmesg for any ACPI events:

dmesg | grep -i acpi

If you need just a remote terminal, then there is no need to keep x-server running. You can try killing it and see if the machine shuts down in this case.

  • Hmmm okay. It does not look like there is a syslog for this distro, but the message log does not say much. hmm this is a strange one.
    – chantheman
    Apr 26, 2011 at 20:57

Add a cron job writing a time stamp into the log every n (possibly n == 1) minutes? Will not help figure the reason, but it could help figure out if shutdown time is correlated with the time you leave your machine or it always turns off at the same time.

Another idea: move /sbin/shutdown to /sbin/shutdown.bin and create a shell script /sbin/shutdown which tells you what called shutdown, (find parent process id from $PPID, run ps auxwww to find out who's messing with the system, save pstree output and generally call the cavalry). This way you should be able to catch the offender red handed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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