[bf1942] restart script

Jon Wolberg jon at defenderhosting.com
Thu Jul 7 11:34:28 EDT 2005


I've just been starting a screen, changing to the root directory and running 
the following:

while /bin/true; do date >> /tmp/crash.log ; ./start.sh; done

This way when it crashes, it at least writes the crash date/time to a file 
so I can go see how often it has gone down later.

Jon
----- Original Message ----- 
From: "David Stevens" <dave at netdefense.ca>
To: <bf1942 at icculus.org>
Sent: Thursday, July 07, 2005 11:24 AM
Subject: RE: [bf1942] restart script


> 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