[CentOS] Help with bash script

Fri Jun 16 12:15:12 UTC 2006
Larry Vaden <vaden at texoma.net>

On 6/16/06, Fajar Priyanto <fajarpri at cbn.net.id> wrote:
> Hi all,
> Can someone pls help me on how to make this bash script?
> I want to monitor a process, and then when the process (for some reason) dies,
> the script will start the process again.

One possible approach is to look at an offering from qmail's author,
D. J. Bernstein <http://cr.yp.to/djb.html>.  DBJ publishes a very
useful set of tools known as daemontools
<http://cr.yp.to/daemontools.html>.  Supervise
<http://cr.yp.to/daemontools/supervise.html> switches to the directory
named s and starts ./run. It restarts ./run if ./run exits. It pauses
for a second after starting ./run, so that it does not loop too
quickly if ./run exits immediately.

Monit <http://www.tildeslash.com/monit/> is a utility for managing and
monitoring, processes, files, directories and devices on a UNIX
system. Monit conducts automatic maintenance and repair and can
execute meaningful causal actions in error situations.

restartWrapper (comes with Radiator) is something that has never
failed our operation in a decade, but I'm not sure what the license
looks like.

rgds/ldv