Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
I think this question belongs to Server Fault. –  Crend King Apr 26 '11 at 19:58
add comment

migrated from stackoverflow.com Apr 27 '11 at 8:35

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 0 down vote accepted

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.

share|improve this answer
    
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 '11 at 20:57
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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