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 small modest CentOS server at home. I run it headless because anytime I access it, it's always via SSH.

Anyways, tonight it became unresponsive to the network. I could not connect to it to investigate. In this case, I have to hook up a keyboard and monitor to see the problem. I ended up just rebooting it.

But after this experience, I was wondering if it's possible to configure the hardware buttons on the CPU case to perform a graceful reboot or graceful power cycle in Linux. Even though the server becomes unresponsive once in a blue moon, it would be nice to simply press a button and have it shutdown all services and gracefully reboot.

Anyone know how this could be accomplished?

share|improve this question

2 Answers 2

If your hardware is ACPI compliant, the archlinux wiki outlines a process which may work for you using a package called acpid. I've had success with this method on other distributions.

https://wiki.archlinux.org/index.php/Shutting_system_down_by_pressing_the_power_button

share|improve this answer

As far as I know using the "power button" to trigger a "graceful reboot" requires a combination of hardware and software.

So if you have a normal running system then going the acpid route in certainly the right way to go.

However if your system is unresponsive (i.e. the numlock light no longer changes when you press the numlock key) then no software in the world is going to help. The system is simply not doing any software anymore. Once your system is in that state the only thing that remains is to keep the power button pressed for about 5 seconds to power down the system (no running OS required) and to simply boot the system.

share|improve this answer

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.