WickedMoonShiner

Looking for input on Multi Servers on 1 system with BEC

3 posts in this topic

So I might be doing this all wrong but wanted input from you all.

I have multi servers on a testing system that I would like to spin up at the same time. That is not the issue as I just change the port but what I have going on is that I use BEC to do my reboots Let me provide you some examples below. 

I have BEC that runs in the background to monitor my server and if anything goes down it auto restarts also when the 4 hours are up scheduler issues a stopserver.bat and then the monitor.bat restarts my startserver.bat.  Is there a easier way because I can't run the scripts as I have it watching the windows because it is going to start shutting down the wrong windows. I feel I might be working harder then I should at this. 

I currently have 1x Exile Server  1x Exile Dev  and  1x Altis Life server 

Scripts I just edit the scripts for each system and then down one to start the other.

restartserver.bat

@echo off
taskkill /f /fi "status eq not responding" /im arma3server.exe
taskkill /f /im arma3server.exe
timeout 1

taskkill /f /im cmd.exe /fi "windowtitle eq Administrator:  servermonitor.bat"
echo Make sure all is clear

cd C:\Servers\Arma3Exile
timeout 3
start "arma3" "C:\Servers\Arma3Exile\arma3server.exe" "-serverMod=@ExileServer;@infiSTAR_servermod;" "-mod=@Exile;" -port=2302 "-config=C:\Servers\Arma3Exile\@ExileServer\config.cfg" "-cfg=C:\Servers\Arma3Exile\@ExileServer\basic.cfg" -profiles=logs -BEPath=C:\Servers\Arma3Exile\battleye -name=logs -malloc=tbbmalloc -nosplash -noSound -noPause -autoinit -enableHT
timeout 30
echo ARMA 3 Server has started
set becpath="C:\Servers\Exile_BEC"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg --dsc
timeout 3
echo Battleye has started.. 
echo.
echo.


set ServerMonitorPath="C:\Servers\Arma3Exile\"
cd /d %ServerMonitorPath%
start "" "servermonitor.bat"
echo Server Monitor has started. Have Fun
timeout 5
exit 

StopServer.bat

@echo off
::KILL ARMA3 SERVER
taskkill /f /fi "status eq not responding" /im arma3server.exe
taskkill /f /im arma3server.exe
timeout 1
::DOUBLE CHECK KILL
taskkill /f /fi "status eq not responding" /im arma3server.exe
taskkill /f /im arma3server.exe
timeout 1

ServerMonitor.bat

@echo off
title servermonitor.bat
:start
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
echo Server is not running, will be started now 
start "" /min /wait "C:\Servers\Arma3Exile\restartserver.bat"
timeout 30
echo Server started succesfully
goto started
:loop
cls
echo Server is already running, running monitoring loop
:started
C:\Windows\System32\timeout /t 80
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
goto start

 

Is there another tool I should check into to help me manage multi servers? Any suggestion would be awesome.  I am open. But I am just a Basic programmer I can't do anything crazy. 

Share this post


Link to post
Share on other sites

Not sure if I get you'r core problem right, but if I do theres an easy solution:

 

rename your arma3server.exe corresponding to your server. Like, name it arma3exileDEV.exe, change all your scripts and .bats to fit the name and voila, it'll only kill/restart the specific server.

You could also go by PID, but thats actually too much hazzle as a secondary way for one that gets it fixed easy as pie.

 

Edit: same for your BEC - it auto-cancels the process when it doesnt find the server any more, but renaming it to easily keep track of which BEC belongs to which server cant hurt

Edited by Starfish
1 person likes this

Share this post


Link to post
Share on other sites

Not sure if I get you'r core problem right, but if I do theres an easy solution:

 

rename your arma3server.exe corresponding to your server. Like, name it arma3exileDEV.exe, change all your scripts and .bats to fit the name and voila, it'll only kill/restart the specific server.

You could also go by PID, but thats actually too much hazzle as a secondary way for one that gets it fixed easy as pie.

 

Edit: same for your BEC - it auto-cancels the process when it doesnt find the server any more, but renaming it to easily keep track of which BEC belongs to which server cant hurt

Thanks that is kinf od what I was looking for. I have been toying with the idea of making a panel with like Server 1 and 2 and 3 in it can I can just click start and stop on it. 

 

Thanks for the input @StarFish

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.