Page 1 of 2

Dedicated server auto restart

Posted: 22 Jan 2015, 14:27
by magnetik
Hi,

You may know that the script in the dedicated server will misbehave after a little more than 12 days.
In order to have your server running for longer period, you have to restart it.

I've crafted a little script that can be used for such purpose: https://gist.github.com/magnetik/83e144959a73e9ce8b50

Before adding it into the debian package, I would like to have some feedback on it.

Feel free to use it, and report bugs about it.

Re: Dedicated server auto restart

Posted: 22 Jan 2015, 15:10
by novationx
Sweet! This can spare us a lot of problems. :thumbsup:

Re: Dedicated server auto restart

Posted: 22 Jan 2015, 16:23
by undef.de
It looks like the dedicated server gets restarted at the given timeout, also when there are Players connected and playing.

A better (imho) solution would be a script which can communicate with the dedicated server and can restart the dedicated server (after the given timeout has reached) when there are no Players connected.

I know that some dedicated servers are never without connected Players, in this case this script can restart then after a hardlimit.

BUT: The best solution would be to have NOT this requirement for restarting. Why not just reset variables that overflow his limits??

Re: Dedicated server auto restart

Posted: 22 Jan 2015, 17:06
by TheBigG.
undef.de wrote: BUT: The best solution would be to have NOT this requirement for restarting. Why not just reset variables that overflow his limits??
+1
That would be the best, there is no reason that you have to restart a server.

Re: Dedicated server auto restart

Posted: 23 Jan 2015, 08:47
by toffe
Auto restart may not occur when any player is on the server. That's my opninion.
And indeed, when making things more efficient you can prevent restarts.

Toffe.

Re: Dedicated server auto restart

Posted: 23 Jan 2015, 08:54
by magnetik
undef.de wrote:It looks like the dedicated server gets restarted at the given timeout, also when there are Players connected and playing.
Indeed. It's only a way to ensure that started server will still works. I should put the exact number of seconds (instead of day) to be as a last resort.
You should use a server controller in order to do something more complex (like restarting the day before as soon as the server is empty).
undef.de wrote: A better (imho) solution would be a script which can communicate with the dedicated server and can restart the dedicated server (after the given timeout has reached) when there are no Players connected.
That can be done (easily) with server controller like eXpansion or ManiaControl.

undef.de & others wrote: BUT: The best solution would be to have NOT this requirement for restarting. Why not just reset variables that overflow his limits??
At the moment it's not possible for complex reasons.

Re: Dedicated server auto restart

Posted: 23 Jan 2015, 13:04
by toffe
Maybe an option to only restart during a time period (like between 00:00 and 06:00 AM) would be enough for the simple work and use without a controller.
And maybe an extra option to also start another script when restarting. :thumbsup:

Toffe

Re: Dedicated server auto restart

Posted: 26 Jan 2015, 10:36
by w1lla
Option is also using a server controller.

I did a test where the server did show in logs it disconnected and reconnected. However ingame players will get a notice after a while of 10054 error connection.

Code: Select all

Starting ManiaPlanet date=2014-11-24_12_34  GameVersion=3.3.0...
Initializing...
Configuration file : dedicated_cfg.default.txt
Loading system configuration...
...system configuration loaded
Loading cache...
...OK
Listening for xml-rpc commands on port 4999.

WARNING:
  * The xml-rpc connection is open to any ip,
  * but the Admin / SuperAdmin password hasn't been changed!
  * Anybody can remotely control the server.

Loading dedicated server configuration...
...Dedicated server configuration loaded
Connecting to master server...
...OK
Identifying on master server...
...OK
Please wait, loading...
Please wait...
URL: maniaplanet://#join=w1llaelite@Trackmania_2@nadeolabs
Match settings file : MatchSettings\TMValley1.txt
Loading match settings...
Map "Campaigns\TMCanyon\White\A08.Map.Gbx" not found.
...Match settings loaded
Autostart server on internet
Starting server...
 - Warning! -
You seem to be on a private network.
Unless you have configured your NAT,
other players on internet will not be
able to join in...
Loading map A01.Map.Gbx (NrnZpfRPTjYxh6wSJ6DSLN7Oq2n)...
...Load succeeds
Starting Match...
...Synchronization
...Play
Connection of a new player: w1lla(84.29.75.107:2350)
...Exit
Disconnection of w1lla(84.29.75.107:2350)
Disconnection of w1llaelite(84.29.75.107:2351)
Loading map A01.Map.Gbx (NrnZpfRPTjYxh6wSJ6DSLN7Oq2n)...
...Load succeeds
Starting Match...
...Synchronization
...Play
Connection of a new player: w1lla(84.29.75.107:2350)
...Exit
Disconnection of w1lla(84.29.75.107:2350)
Disconnection of w1llaelite(84.29.75.107:2351)
Loading map A01.Map.Gbx (NrnZpfRPTjYxh6wSJ6DSLN7Oq2n)...
...Load succeeds
Starting Match...
...Synchronization
...Play
Did this with:

Code: Select all

$this->connection->stopServer();
$this->connection->startServerInternet();
And it does seem to work. But i am no expert in this ^^

Re: Dedicated server auto restart

Posted: 02 Feb 2015, 09:44
by magnetik
I've modified the script to be an "ultimate" restart: if you haven't done anything before, it will restart it to prevent your server from being frozen.

Re: Dedicated server auto restart

Posted: 05 Mar 2015, 21:11
by sotn0r
Sorry for being a bit off-topic, but can you give me a hint at which version of the mp server this "12 days" bug has started to occur and what it's effects are?