Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: mjr@hussar.dco.dec.com (Marcus J. "Will do TCP/IP for clues" Ranum)
Subject: Re: Help...
Date: Mon, 26 Oct 1992 18:57:29 GMT	[thread overview]
Message-ID: <1992Oct26.185729.25420@decuac.dec.com> (raw)
In-Reply-To: 1992Oct25.050041.20443@ncsu.edu

>I need to run a shell script that will check to see if a process is
>running, and if it is not, then make run it.

	This is usually done by having the process you want to check write
its process-id to a file someplace. The second process just sits in a loop
and wakes up every minute (or whatever) and does a "kill 0" on the process
you want to check. You then test the exit value of kill. Easy.

#!/bin/sh
while true; do
	sleep 60
	kill -0 `cat /some/dir/process.pid`
	if [ $? -ne 0 ]; then
		echo "process died"
		/start/some/process
	fi
done

mjr.

PS - (another option is to not run those LPMuds that crash alla time, if
that was your question. ;) )
-- 
	You can't fix stupidity with software.
						-notebooks of a heretic


  reply	other threads:[~1992-10-26 18:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-10-25  5:00 Help JENNIFER KAYE SCOTT
1992-10-26 18:57 ` Marcus J. "Will do TCP/IP for clues" Ranum [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-12-31  5:00 help K9SigTau
2000-08-11  4:00 Help poyaes
2000-08-15  4:00 ` Help SkiDad
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox