Page 1 of 1

Query & restart if empty

Posted: Mon Aug 17, 2015 6:05 pm
by mdn
Currently running a Rust server.

Issue: Last night the game server was online / running but players were not able to connect.

Purposed Solution: Using Brainless logs verify the last time server was started / stopped. If uptime is greater than X and population is less than Y, restart game service. First using graceful. Should it still not exit after Z seconds, force restart.

Example: Rust process was started 2 hours ago. Population according to query is 0. Restart after it's been empty for 10 minutes.

This could be used for other games where query is enabled to perform a (daily) restart when it's empty. The purpose of waiting 10 minutes before issuing the restart command is to ensure that the server is actually empty due to an issue and not simply because of a network issue causing the server to drop population for 1 or 2 minutes. If after 10 minutes players haven't reconnected the chances are high that either it's going to stay empty or there is an issue.

Thank you for your consideration. Being able to have our game servers run unattended for as long as possible would be great.

Re: Query & restart if empty

Posted: Mon Aug 17, 2015 7:04 pm
by Masher
You should be able to do this now with the automatic restart settings. Set the server to restart at 00:10 (or whatever time as long as the hour is 00), set the hourly restart to 1. Then set the min user count to 1. The panel will restart the server every hour if it's empty.

Re: Query & restart if empty

Posted: Mon Aug 17, 2015 11:56 pm
by mdn
Lovely, thank you.

I will mention that before I submitted this question I browsed several other threads to see what I could expect. I found that several of the feature requests were already implemented. At this point I then went through the software again to make sure my question didn't share the same fate. Bah. =(

Re: Query & restart if empty

Posted: Wed Aug 19, 2015 6:03 am
by Masher
No problem. ;)