I set up cronjobs to restart the server and Maniacontrol once every day.
Most of the time it works fine but on some days something weird happens and the plugin won't load anymore.
I set a default XMLRPC port in the config but on some days, after a restart, it happens that this port changes and goes up +1 !?
Because of this weird port change, the plugin is no longer able to load (makes sense)...
I thought that it might have something to do with timeout or the port still being blocked after the server had been shut down ?!
Does the Maniaplanet server add +1 to the xmlrpc port if the default port in the config is blocked/not available/already used ?
XMLRPC Port changes after restart ?!
Moderator: NADEO
-
- Posts: 30
- Joined: 20 May 2018, 01:41
XMLRPC Port changes after restart ?!
Last edited by Nicklander on 16 Jun 2019, 13:49, edited 1 time in total.
Re: XMLRPC Port changes after restart ?!
yes, it does.Does the Maniaplanet server add +1 to the xmlrpc port if the default port in the config is blocked/not available/already used ?
nc1.eu - TMF, TM² and ShootMania servers with first class support, control panel, FTP access and more..!
https://nc1.eu/
http://facebook.com/nc1.eu/
https://twitter.com/nc1eu/



-
- Posts: 30
- Joined: 20 May 2018, 01:41
Re: XMLRPC Port changes after restart ?!
My cronjob in Debian looks like this:
# Stop TM2 Maniacontrol
1 6 * * * kill `pgrep -f ManiaControl_nickserver.php`
# Stop TM2 Server
2 6 * * * kill `pgrep -f nickserver`
# Start TM2 Server
5 6 * * * cd /path/to/nickserver; ./nickserver /game_settings=MatchSettings/tracklist.txt /dedicated_cfg=dedicated_cfg.txt
# Start TM2 Maniacontrol
7 6 * * * cd /path/to/nickserver/ManiaControl; php ManiaControl_nickserver.php >ManiaControl.log 2>&1 &
I wonder why it changes the port...
I mean all I do is shutting down the server and starting it up again...
# Stop TM2 Maniacontrol
1 6 * * * kill `pgrep -f ManiaControl_nickserver.php`
# Stop TM2 Server
2 6 * * * kill `pgrep -f nickserver`
# Start TM2 Server
5 6 * * * cd /path/to/nickserver; ./nickserver /game_settings=MatchSettings/tracklist.txt /dedicated_cfg=dedicated_cfg.txt
# Start TM2 Maniacontrol
7 6 * * * cd /path/to/nickserver/ManiaControl; php ManiaControl_nickserver.php >ManiaControl.log 2>&1 &
I wonder why it changes the port...
I mean all I do is shutting down the server and starting it up again...
Re: XMLRPC Port changes after restart ?!
Have you checked if your server is actually shut down once your cron starts it again? Your server logs should give you a hint at which times your server was shut down.
If you don't mind a non-graceful shutdown, you could add the -9 parameter to your kill command.
If you don't mind a non-graceful shutdown, you could add the -9 parameter to your kill command.
nc1.eu - TMF, TM² and ShootMania servers with first class support, control panel, FTP access and more..!
https://nc1.eu/
http://facebook.com/nc1.eu/
https://twitter.com/nc1eu/



Re: XMLRPC Port changes after restart ?!
TCP/IP has a session shut down time of up to 2 minutes.
If you try to reuse the same port right after closing the server application, it is still blocked, hence a new port is used.
This means that you need to add a delay in your restart script.
Or you check which port is free and dynamically create a new config file with that port from a template with your usual setings.
If you try to reuse the same port right after closing the server application, it is still blocked, hence a new port is used.
This means that you need to add a delay in your restart script.
Or you check which port is free and dynamically create a new config file with that port from a template with your usual setings.
-
- Posts: 30
- Joined: 20 May 2018, 01:41
Re: XMLRPC Port changes after restart ?!
Well if that is so then I will just add more delay in my cronjobs and maybe even kill everything twice (maybe also use pkill)TMarc wrote: ↑16 Jun 2019, 17:13 TCP/IP has a session shut down time of up to 2 minutes.
If you try to reuse the same port right after closing the server application, it is still blocked, hence a new port is used.
This means that you need to add a delay in your restart script.
Or you check which port is free and dynamically create a new config file with that port from a template with your usual setings.
Re: XMLRPC Port changes after restart ?!
You can always check the port usage with
netstat -na
netstat -na
Re: XMLRPC Port changes after restart ?!
Anyway, in my eyes the dedicated server should not use a different port as the configured one, just stop if the configured port is not available as other daemons do too.
To pick an other port just bring problems, the controller can't connect or the port forwarding doesn't work on that port... (because the behavior for the Connection and P2P-ports are the same).
To pick an other port just bring problems, the controller can't connect or the port forwarding doesn't work on that port... (because the behavior for the Connection and P2P-ports are the same).
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Visit the official website for more: UASECO.org
Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name
You like what I do? Then award a ManiaStar.
Re: XMLRPC Port changes after restart ?!
absolutely right!
-
- Posts: 30
- Joined: 20 May 2018, 01:41
Re: XMLRPC Port changes after restart ?!
I agree... the automatic port change is useless and just causes problems in the end.undef.de wrote: ↑16 Jun 2019, 19:41 Anyway, in my eyes the dedicated server should not use a different port as the configured one, just stop if the configured port is not available as other daemons do too.
To pick an other port just bring problems, the controller can't connect or the port forwarding doesn't work on that port... (because the behavior for the Connection and P2P-ports are the same).
If you start the server and the configured port isn't open, it should simply show an error message and shut the server down.
Who is online
Users browsing this forum: No registered users and 1 guest