Razzmatazzz / ValheimServerWarden

Manage one or more Valheim dedicated server instances.
GNU General Public License v3.0
38 stars 4 forks source link

Close Program on Shutdown/Reboot #40

Closed txcanyon closed 2 years ago

txcanyon commented 3 years ago

Great program, loving the ability to setup/manage my VH server and with the save utility, it's an all around great combo.

One question: Is there a way to trigger the program to close when the system shuts down/reboots? I have it starting up on login (Server 2019 via startup folder) which then triggers the server to start. However in the event of a shutdown or reboot, I would need to manually close the program out.

Did you build any function into the app to be able to close it by other means? Using nssm to install it as a service it works great for starting, but stopping the service does kill everything, just not gracefully. Is there anything here: https://nssm.cc/usage#shutdown that can be used?

Thanks again.

Razzmatazzz commented 3 years ago

If you create/copy a file named "shutdown.now" in the VSW app folder while the app is running, it will gracefully shut down the servers and close the app. If you have scheduled system restarts, you could also schedule the creation of that file a minute or so beforehand.