Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Mar 2001 13:53:46 -0600 (CST)
From:      Nick Rogness <nick@rogness.net>
To:        Bill Mitcheson <turtle@pyramus.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: I need a script.
Message-ID:  <Pine.BSF.4.21.0103151346410.5117-100000@cody.jharris.com>
In-Reply-To: <3AB11A0E.EF2C79D3@pyramus.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 15 Mar 2001, Bill Mitcheson wrote:

> I'm looking for a script that will automatically restart a daemon. We
> are experiencing the following error:
> 
> pid 7458 (named), uid 53: exited on signal 6
> 
> We would like to have a script that would search for the named process
> and restart it if it is not found. Any help would be greatly
> appreciated!


#!/usr/local/bin/ksh

let X=1
while [[ $X -eq 1 ]]; do

	ISRUNNING=`ps -auxww |grep named|grep -v grep|wc -l`
	if [[ $ISRUNNING -eq 0 ]]; then
		named
	else
		sleep 30
	fi
done


	You will need to adjust this a bit but it *seems* to work OK.  You
	should look into why named is existing.

Nick Rogness <nick@rogness.net>
- Keep on routing in a Free World...  
  "FreeBSD: The Power to Serve!"




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0103151346410.5117-100000>