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?


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.



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.

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.