Safely Shuting Down PZroxmox from CLI for UPS

haxxa

Renowned Member
Jun 26, 2015
37
6
73
Hi Everyone,

I have recently set up a server with a UPS as I have experienced a few power cuts as of late, I use Network UPS Tools (NUT) to shutdown the server in the event of a power outage. Currently it uses "shutdown -h 0" to shutdown the server however this is undesirable as the LXC containers and KVM VMs are shutdown unsafely. Is there a cli comand similar to the shutdown button in the web ui that enables all the conatiners and vms to be closed cleanly before proceeding to shutdown?

Regards - Haxxa
 
Try:
Code:
/sbin/poweroff

We execute this one also when pressing the button in the webinterface.

On PVE4 beta (1 and 2) which you seem to have ( you mentioned LXC) you could use:
Code:
systemctl poweroff
systemd should then handle everything :)
 
I assume default, is not healthy for save shutdown of all LXC or VM right?

Code:
SHUTDOWNCMD "/sbin/shutdown -h +0"