Jump to content

Sign in to follow this  
TruWrecks

Auto-Restart Server Grid

Recommended Posts

Until a better method is available I wrote my own method to auto-restart a server on crash.

Start by making a batch file to launch all of the grid servers in their own process.

 

GridStart.bat

START /W D:\Servers\Atlas\steamcmd\steamcmd +login anonymous +force_install_dir D:\Servers\Atlas +app_update 1006030 +quit

timeout /t 10
START /W xcopy /EY C:\Users\truwr\Documents\Atlas\Saved\A1\Config\\WindowsServer\Game.ini D:\Servers\Atlas\ShooterGame\Saved\A1\Config\\WindowsServer\Game.ini
START /W xcopy /EY C:\Users\truwr\Documents\Atlas\Saved\A1\Config\\WindowsServer\Game.ini D:\Servers\Atlas\ShooterGame\Saved\A2\Config\\WindowsServer\Game.ini
START /W xcopy /EY C:\Users\truwr\Documents\Atlas\Saved\A1\Config\\WindowsServer\Game.ini D:\Servers\Atlas\ShooterGame\Saved\B1\Config\\WindowsServer\Game.ini
START /W xcopy /EY C:\Users\truwr\Documents\Atlas\Saved\A1\Config\\WindowsServer\Game.ini D:\Servers\Atlas\ShooterGame\Saved\B2\Config\\WindowsServer\Game.ini

START CMD /C CALL D:\Servers\Atlas\AtlasTools\RedisDatabase\redis-server_start.bat
timeout /t 5
START CMD /C CALL Grid1.bat
echo Press Ctrl-C if you don't want to restart automatically
timeout /t 10
START CMD /C CALL Grid2.bat
echo Press Ctrl-C if you don't want to restart automatically
timeout /t 10
START CMD /C CALL Grid3.bat
echo Press Ctrl-C if you don't want to restart automatically
timeout /t 10
START CMD /C CALL Grid4.bat
echo Press Ctrl-C if you don't want to restart automatically
timeout /t 10

Grtd1.bat

@Echo off
:Start
ShooterGameServer.exe Ocean?ServerX=0?ServerY=0?AltSaveDirectoryName=A1?MaxPlayers=20?ReservedPlayerSlots=10?QueryPort=57550?Port=5750?SeamlessIP=x.x.x.x -log -server -NoBattlEye -ExclusiveJoin
echo Press Ctrl-C if you don't want to restart automatically
ping -n 30 localhost

goto Start

 

Grtd2.bat

@Echo off
:Start
ShooterGameServer.exe Ocean?ServerX=1?ServerY=0?AltSaveDirectoryName=A2?MaxPlayers=20?ReservedPlayerSlots=10?QueryPort=57551?Port=5751?SeamlessIP=x.x.x.x -log -server -NoBattlEye -ExclusiveJoin
echo Press Ctrl-C if you don't want to restart automatically
ping -n 30 localhost

goto Start

 

Grtd3.bat

@Echo off
:Start
ShooterGameServer.exe Ocean?ServerX=0?ServerY=1?AltSaveDirectoryName=B1?MaxPlayers=100?ReservedPlayerSlots=30?QueryPort=57552?Port=5752?SeamlessIP=x.x.x.x -log -server -NoBattlEye -ExclusiveJoin
echo Press Ctrl-C if you don't want to restart automatically
ping -n 30 localhost

goto Start

 

Grtd4.bat

@Echo off
:Start
ShooterGameServer.exe Ocean?ServerX=1?ServerY=1?AltSaveDirectoryName=B2?MaxPlayers=20?ReservedPlayerSlots=10?QueryPort=57553?Port=5753?SeamlessIP=x.x.x.x -log -server -NoBattlEye -ExclusiveJoin
echo Press Ctrl-C if you don't want to restart automatically
ping -n 30 localhost

goto Start

 

This is the most elegant method I can find that will it will get the server back up and running within 30 seconds of a crash.

 

Updated start script to launch Redis, check for server updates, copy game.ini with any changed I want to push to my servers, then launch the grid servers with a 10 second delay between each so they load faster.

Edited by TruWrecks
Improvements
  • Like 1

Share this post


Link to post
Share on other sites
23 hours ago, TruWrecks said:

Until a better method is available I wrote my own method to auto-restart a server on crash.

Start by making a batch file to launch all of the grid servers in their own process.

 

GridStart.bat

START CMD /C CALL redis-server_start.bat
D:\Servers\Steam\steamcmd +login anonymous +force_install_dir D:\Servers\Atlas +app_update 1006030 +validate +quit
START CMD /C CALL Grid1.bat
START CMD /C CALL Grid2.bat
START CMD /C CALL Grid3.bat
START CMD /C CALL Grid4.bat
echo Press Ctrl-C if you don't want to restart automatically

 

Grtd1.bat

@Echo off
:Start
ShooterGameServer.exe Ocean?ServerX=0?ServerY=0?AltSaveDirectoryName=B1?MaxPlayers=20?ReservedPlayerSlots=10?QueryPort=57550?Port=5750?SeamlessIP=x.x.x.x -log -server -NoBattlEye -ExclusiveJoin
echo Press Ctrl-C if you don't want to restart automatically
ping -n 30 localhost

goto Start

 

Grtd2.bat

@Echo off
:Start
ShooterGameServer.exe Ocean?ServerX=1?ServerY=0?AltSaveDirectoryName=B1?MaxPlayers=20?ReservedPlayerSlots=10?QueryPort=57551?Port=5751?SeamlessIP=x.x.x.x -log -server -NoBattlEye -ExclusiveJoin
echo Press Ctrl-C if you don't want to restart automatically
ping -n 30 localhost

goto Start

 

Grtd3.bat

@Echo off
:Start
ShooterGameServer.exe Ocean?ServerX=0?ServerY=1?AltSaveDirectoryName=B1?MaxPlayers=100?ReservedPlayerSlots=30?QueryPort=57552?Port=5752?SeamlessIP=x.x.x.x -log -server -NoBattlEye -ExclusiveJoin
echo Press Ctrl-C if you don't want to restart automatically
ping -n 30 localhost

goto Start

 

Grtd4.bat

@Echo off
:Start
ShooterGameServer.exe Ocean?ServerX=1?ServerY=1?AltSaveDirectoryName=B1?MaxPlayers=20?ReservedPlayerSlots=10?QueryPort=57553?Port=5753?SeamlessIP=x.x.x.x -log -server -NoBattlEye -ExclusiveJoin
echo Press Ctrl-C if you don't want to restart automatically
ping -n 30 localhost

goto Start

 

This is the most elegant method I can find that will it will get the server back up and running within 30 seconds of a crash.

Hey there,

So if 1 instance dies for whatever reason, it will restart itself with no user intervention? What is the script doing exactly for each instance?

Starts the grid. Echos a msg and pings for 30 seconds and loops back?  Does it know not to execute the grid again if its already running?

Share this post


Link to post
Share on other sites

The script pauses while the server is running. If the server crashes for any reason the script counts to 30 and keeps checking for the process in case it recovers. If it doesn't recover in 30 seconds the script launches the server again. Each grid tile is monitored individually and can be recovered 1 at a time. Launching the main launch script should ignore the existing servers, but I need to test that a bit further to make sure.

  • Like 1

Share this post


Link to post
Share on other sites

Nice script! By the way, you can edit DefaultGame.ini, for example, to have settings which persist across all zones. This is what I did for zones where I have identical settings such XP rates. I only go to the specific save folder ini's for applying zone specific settings. Seems to work for me.

Share this post


Link to post
Share on other sites
1 hour ago, Ixel said:

Nice script! By the way, you can edit DefaultGame.ini, for example, to have settings which persist across all zones. This is what I did for zones where I have identical settings such XP rates. I only go to the specific save folder ini's for applying zone specific settings. Seems to work for me.

I found that validating the atlas server folder with steamcmd resets the defaults

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...