Summary: Watchdog Script
From: Andreas Hoeschler (ahoesch_at_smartsoft.de)
Date: 09/08/03
- Previous message: Andreas Hoeschler: "Watchdog Script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 8 Sep 2003 16:02:49 +0200 To: sunmanagers@sunmanagers.org
Dear managers,
thanks for the overwhelming response.
"Mike Demarco" <mdemarco@tritonpcs.com>
Reggie Beavers <reggiebeavers@fstha.com
Tony_Schloss@ao.uscourts.gov >
"Simon Phillips" <Simon.Phillips@uhi.ac.uk>
"Skip Hammack" <skip.hammack@starband.net>
"MURAT BALKAS" <murat.balkas@rtnet.net.tr>
"Gurugunti, Mahesh" <MGurugunti@us.nomura.com>
The easiest solution was suggested by Tony Schloss and looks as follows:
> #!/bin/sh
>
> if [ ! `/usr/bin/pgrep OurService` ] ; then
> nohup ./OurService &
> fi
>
> exit 0
Others suggested to use inittab or respawn (see man pages). I will try
that as well. However, since in the general case I need to path
parameters the avove script/crontab seems the best.
Thanks a lot,
Andreas
The questions was as follows
Dear managers,
we have a service process running in the background that unfortunately
dies from time to time. We are researching why. However, until we have
found the bug we would like to setup a script that is called by cron
every 5 mins. This script should check whether the process is still
running with something like
ps -Af | grep OurService
and if it is not then restart it with
nohup ./OurService &
I have no idea how such a shell script would look like. Ideas are
greatly appreciated.
Thanks ins advance!
Regards,
Andreas
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
- Previous message: Andreas Hoeschler: "Watchdog Script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|