Proxmox won't shutdown (calling shutdown from crontab)

xtv

Member
Jan 18, 2023
6
0
6
As described in this thread , the recommended way to set up some commands/scripts to run at startup was to add a @reboot entry in the crontab file.

Sometimes I won't be using my Proxmox home server for days, and I don't want it to keep up and running.
For that, I have my machine configured to wake up (in bios) every day at a specific time, and I added a shell script to be run at boot time that checks a remote server (HTTP request) whether it should keep up or shut down.
If it is to shut down, a "shutdown -P 1" is called from this script.
However, that just won't work. The machine will keep up and running forever.
If I ssh into this machine and call the shutdown, it will shutdown.
I added some logs in this script to make sure it's being called, and what user is calling it, and it is being called by root.
I have no idea what's going on.
Any clues?

PS: The server is at my parent's place, that's why I won't just power it on or off manually.
 
If it is to shut down, a "shutdown -P 1" is called from this script.
However, that just won't work. The machine will keep up and running forever.
What does shutdown -P 1 do when your run it in a console? Shutdown usually requires you to specify a time to shut down. Try using shutdown -h now to make the system shut down immediately.