Sign in to follow this  
Sheryl

auto-restart

Recommended Posts

Hi all

Did some searching this morning but didnt really find an answer, if one exists.

Its a simple addition to add some kind of program monitoring in windows to restart a server that has hard crashed. Or one to start a server if windows itself is rebooted. The kind of thing all the various game providers do when polling intervals fail. Some rename existing game/console_mp files with the time/date so it doesnt overwrite it and others can try and track down the problem itself, which is very nice.

However is it possible to do the same thing for a server that has simply stopped but not crashed? Nobody is perfect and things get missed or some obscure issue never seen before pops up either with the mod or a map.

Share this post


Link to post
Share on other sites
Posted (edited)
46 minutes ago, Sheryl said:

Hi all

Did some searching this morning but didnt really find an answer, if one exists.

Its a simple addition to add some kind of program monitoring in windows to restart a server that has hard crashed. Or one to start a server if windows itself is rebooted. The kind of thing all the various game providers do when polling intervals fail. Some rename existing game/console_mp files with the time/date so it doesnt overwrite it and others can try and track down the problem itself, which is very nice.

However is it possible to do the same thing for a server that has simply stopped but not crashed? Nobody is perfect and things get missed or some obscure issue never seen before pops up either with the mod or a map.

don't know if this will help you - when i was running my test server in windows I started it with a batch file which would restart the server on a crash or if I manually stopped the server. I will post it here and you can edit it to see if it will help you.

 

@echo off
cls
echo Automatic server restarter...
echo If you want to close the server close this window first before closing your server console
echo (%date%) - (%time%) test Server1 Started port 28968.
echo (%date%) - (%time%) test Server1 Started port 28968. >>restart1.txt
:server
start /wait BaseGame/cod4x18_dedrun.exe +set fs_basepath "BaseGame" +set fs_homepath "Server1" +set fs_game "mods/bluezone" +exec server.cfg +set net_port 28968 +set r_xassetnum "xmodel=1200 xanim=3200"  +map_rotate

echo (%date%) - (%time%) WARNING: Test Server1 closed or dropped... server restarted.
echo (%date%) - (%time%) WARNING: Test Server1 closed or dropped... server restarted. >>restart1.txt
goto server
pause

 

also you can add it to windows startup to start the server on a reboot

Edited by wkuzma

Share this post


Link to post
Share on other sites

Yea that will work if the process itself quits one way or another. However there may be times when the server simply stops and the process itself continues. Say with a script error for example or some other assert failure.

Typically I think in such cases its only handled by manual restarts via whichever control panel of choice. Maybe that means its not really possible to look for this kind of thing unless done by the program itself. If nothing goes wrong this is never needed, But I have been around long enough to know that anything can happen no matter how careful or attentive you are.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this