Summary: Watchdog Script

From: Andreas Hoeschler (ahoesch_at_smartsoft.de)
Date: 09/08/03

  • Next message: Murray Robert-rmurra01: "Can't remove large file"
    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


  • Next message: Murray Robert-rmurra01: "Can't remove large file"

    Relevant Pages

    • Watchdog Script
      ... we have a service process running in the background that unfortunately ... We are researching why. ... found the bug we would like to setup a script that is called by cron ... This script should check whether the process is still ...
      (SunManagers)
    • Re: OS X cron or equivelent?
      ... In article, Tim Hodgson wrote: ... it sounds as though the easiest solution is the ... earlier one of triggering the script from iCal. ...
      (uk.comp.sys.mac)
    • Re: MSDE and replication
      ... Yes - but like Personal Edition it can't be a Transactional Publisher. ... You can set up replication entirely from scripts - the easiest solution is ... to set up a dummy subscriber using EM and then script it out. ...
      (microsoft.public.sqlserver.replication)
    • Re: Timeout on Xserver for client connections
      ... The easiest solution is to run a script in the background; ... that check checks periodically whether laptop is connected ... to the LAN, and if not, kills your client. ...
      (comp.windows.x)