From owner-freebsd-isp Thu May 8 10:43:44 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA09592 for isp-outgoing; Thu, 8 May 1997 10:43:44 -0700 (PDT) Received: from homer.duff-beer.com (mail@homer.duff-beer.com [194.207.51.241]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA09568; Thu, 8 May 1997 10:43:38 -0700 (PDT) Received: (from scot@localhost) by homer.duff-beer.com (8.8.5/8.8.5) id SAA04562; Thu, 8 May 1997 18:42:03 +0100 (BST) Date: Thu, 8 May 1997 18:42:02 +0100 (BST) From: Scot Elliott To: Anthony Barlow cc: freebsd-questions@FreeBSD.ORG, freebsd-isp@FreeBSD.ORG Subject: Re: Script to check if porgram is running In-Reply-To: <199705081550.QAA09361@mail.warp.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-isp@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Thu, 8 May 1997, Anthony Barlow wrote: > Hi > > Does anyone have a script to check if radiusd is running that can be run > from the cron? > > After a few login failures it seems to exit with the following: > > exited on signal 10 (core dumped) > > Regards, > Anthony > > Well kind-of... I use the script below to keep PPP up during certain free- call hours. Just change the PPP process name to radiusd: -------------------------------------------------------------------------- #!/usr/bin/perl $PPPcommand="ppp -auto bogo"; open( InPipe, "ps -xa|"); # make sure PPP isn't running for( ) { $thisProc = $_; $thisProc =~ /([0-9]+).+\b[0-9]+\b\s(.*)$/; # $1 is PID; $2 is process name $PID = $1; $NAME=$2; if( "$NAME" eq "$PPPcommand" ) { exit; } } close (InPipe); # OK - PPP not running - so start it and restart socks system($PPPcommand); -------------------------------------------------------------------------- Scot. ----------------------------------------------------------------------------- Scot Elliott scot@poptart.org Tel: +44 (0)171 2322924 ----------------------------------------------------------------------------- Public key available by finger at: finger scot@poptart.org or at: http://www.poptart.org/pgpkey.html