Skip to main content

Stop A Power Button Press From Shutting Down The Host

Introduction

What we are trying to prevent here is to not shutdown the Proxmox host from a momentary press of the Power Button on the host. My cat was the inperation for this.

Console To Your Proxmox Host

Fist we will need to ssh to the Proxmox host that you want to ignore momentary Powe Button presses.

Use your favorite method to access the console of your Proxmox host

Edit the Control File

We will need to edit the logind.conf file to add the correct entry to have the Proxmox host ignore a momentary button press of the Power Button.

nano /etc/systemd/logind.conf

Add the correct control command

While editing the logind.conf file add the following line in the file.

HandlePowerKey=ignore

Apply The Changes

Lets restart the daemon so a reboot is not nessesary to apply the change. Execute the following commands

systemctl daemon-reload
systemctl restart systemd-logind.service

 

Conclusion

Now you should be safe when your cat tries to power down your Proxmox host.