XCP-NG use powerbutton to shutdown Server

0

The user has an XCP-NG Server for a home lab that they wish to shut down quickly and easily without using XOA or shell. They couldn’t find a direct solution for XCP, so they adapted a method from CentOS. By editing the /etc/systemd/logind.conf file to modify the power key behavior, they achieved a quick shutdown process.

Quick one. I use a XCP-NG Server as a home Lab. However that thing is used on demand aka sitting next to it, I want to quickly shuit it down without having to go over XOA or the shell.

I wasn’t able to find any solution for XCP, but since it’s based on RedHat/Centos/thelikes I used a method from CentOS to get this quick and easy done.

All I do is add 2 lines to the /etc/systemd/logind.conf

vi /etc/systemd/logind.conf

search and replace the following lines with the below:

HandlePowerKey=poweroff
PowerKeyIgnoreInhibited=yes

After a reboot, I was able to shutdown the server using the power button.

Leave a Reply