From 3c80cf38f33bef90deedc6e410e7452d6ac4568e Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Mon, 10 Jun 2002 20:33:09 +0000 Subject: [PATCH] add checking in already_running() to make sure process is a spong-network process before exiting --- src/spong-network.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/spong-network.pl b/src/spong-network.pl index 05dff0b..d237636 100755 --- a/src/spong-network.pl +++ b/src/spong-network.pl @@ -17,7 +17,7 @@ # (2) Converted checks to new plugin mechanism (Stephen Johnson May 28, 1999) # Added user-configurable escalation mechanism # -# $Id: spong-network.pl,v 1.41 2002/04/18 15:39:00 sljohnson Exp $ +# $Id: spong-network.pl,v 1.42 2002/06/10 20:33:09 sljohnson Exp $ use Carp; use lib "@@LIBDIR@@"; @@ -535,8 +535,11 @@ sub already_running { close PID; if ( kill 0,$pid ) { - &error("Spong-network is already running as pid $pid"); - exit 1; + `ps -f -p $pid | grep spong-network >/dev/null`; + if ( ! $? ) { + &error("Spong-network is already running as pid $pid"); + exit 1; + } } } } -- 2.30.2