Summary: Watchdog Script

From: Andreas Hoeschler <ahoesch_at_smartsoft.de>
Date: Mon Sep 08 2003 - 10:02:49 EDT
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
Received on Mon Sep 8 10:06:52 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:19 EST