[bf1942] restart script
David Stevens
dave at netdefense.ca
Thu Jul 7 11:24:19 EDT 2005
Oddly enough, not a lot of people have asked for it.
Mine is 2 parts
#########################servermonitor#########################
#! /bin/sh
#full path to the start script for the process you want to monitor
exec=/home/stoop/bf2/start.sh
#process name
procName=bin/bf2
#setting the column boundries for cutting the pid from ps
char1=1
char2=6
#interval the script checks to see if the process is still running
interval=10
while :
do
pid=$(ps ax |grep $procName |cut -c$char1-$char2)
echo $pid
if pid=null
then
date >> restartlog
echo $procName has stopped!!!! Starting $procName!!!! >> restartlog
echo " "
echo " "
$exec
fi
sleep $interval
done
#####################################################
######################startit.sh#######################
screen -dmS easucks /home/stoop/bf2/servermonitor
####################################################
To attach to the screen, do screen -r
If you run more than one server, you need to change the screen name for
each.. (in this case, screenname is easucks)
Thanks to Rene Belloq for his help / building of this.
-----Original Message-----
From: Tim Cooper [mailto:tim at myinternetservices.com]
Sent: Thursday, July 07, 2005 10:19 AM
To: bf1942 at icculus.org
Subject: [bf1942] restart script
I am sure this has been asked a 1000 times and maybe I missed it.
Dioes anyone have a restart script? ...... my patched linux server are
crashing constantly ..
I have many ranked servers and out of 11 of them 7 have crashed more then
once with e seq fault
More information about the Bf1942
mailing list