SARS v0.2 - Soldatserver restart (on crash perl) script
About:
------
SARS is a Perl script that (kills and) restarts soldatserver when it crashed.
It checks the modification time of /logs/gamestate.txt and if has not been modified for some time it kills the soldatserver and runs it again.
There four scripts: 2 for Windows and 2 for Linux.
The script for windows works on windows server 2003.
Setup:
------
Before u run a script u need to edit the perl script:
change the $soldatserver_path and $soldatserver_args (arguments) and $soldatserver_count (when ur using SARS v0.2m)
and remove the line:
exit # remove this line!
Note that you need 2 slashes (\\) for windows
winSARS_m.pl and winSARS_s.pl are for Windows Server 2003/ Windows XP Pro and Home / Windows Vista
linSARS_m.pl and linSARS_s.pl are for Linux
*_m.pl can manage one or more servers
*_s.pl can manage one server only
You need to have perl install to run the scripts.
Get it at
www.activestate.com (Windows)
or install it with the packet manager (Linux).
SARS needs the server to have logging enabled in the Soldat.ini.
If you don't want to use logging use the script to make SARS work.
Then you need to have scripting enabled.
DON'T use the script when you have logging enabled!
When you run Windows XP Home or want to kill the server with -9 (Linux) you need to enable the alternative mode.
Just change the value from 0 to 1.
If you don't want to see the actions that SARS does you need to change sowactions to
$showactions=0;
When you dont want to start the Soldatserver minimized you need to edit the runserver variable (Windows).
It's possible to change the delay when changeing mins_to_wait variable but it's not recommended.
Default delay is 3 min.
Once you setup SARS correctly you can run the perlscript.
It doesn't need to be in the soldatfolder since you use relative paths (line you can see in the script).
FOR *NIX
Run the script with "./linSARS_s.pl &" or start it in a screen.
Don't run it with "> /dev/null" since that can cause problems better just set showactions to 0 instad.
FOR WINDOWS
Double click on the perlfile or run it in cmd.exe/command.com.
Changelog:
---------
v0.2
fixed missing bracket causes syntax error when starting in linSARS_m and winSARS_m.pl
fixed starting SARS before soldatserver will quit SARS and not run the soldatserver
fixed formating errors
fixed reading of gamestats.txt when file doesn't exist
added alternative mode
added better status messages
added showactions option to hide status messages
added more detailed logmessages
added runserv option to change starting command
added SARS soldatserverscript for servers without logging enabled
changed output of dot's in a line for multiple servers
Credits:
--------
Seastorm - asking me to code that script, for testing and help
Chrisgbk - help
Everyone who uses SARS and gave me feedback.