From 081fa89a29b48dc9e2fdf7abdff74884e786b8b2 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Wed, 27 Sep 2000 03:45:06 +0000 Subject: [PATCH] allow --nosleep to run with another instance. pass debug value on --restart. fixed broken check_local() that wasn't being executed --- src/spong-client.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/spong-client.pl b/src/spong-client.pl index d71eebb..9f3c6ac 100755 --- a/src/spong-client.pl +++ b/src/spong-client.pl @@ -195,7 +195,7 @@ sub handle_signals { } # Check to see if we are already running - &already_running(); + &already_running() unless $nosleep; # Write our pid to the spong tmp directory. @@ -239,7 +239,7 @@ sub hup_handler { &debug( "caught HUP signal, restarting..." ); unlink "$SPONGTMP/spong-client.pid" if -f "$SPONGTMP/spong-client.pid"; $SIG{$_[0]} = \&hup_handler; - if( $debug ) { exec $me, "--debug"; } else { exec $me; } + if( $debug ) { exec $me, "--debug", $debug; } else { exec $me; } exit(0); } @@ -257,7 +257,6 @@ sub load_checks { if (! defined $CHECKS || ! $CHECKS ) { $CHECKS = 'disk cpu processes logs'; - if (defined &check_local) { $CHECKS .= ' local'; } }; foreach $check (split / /,$CHECKS) { @@ -265,6 +264,12 @@ sub load_checks { eval "require 'Spong/Client/plugins/check_$check';"; if ( $@ ) { &error( "Could not load $check check plugin" ); } } + + if (defined &check_local) { + &debug( "Loading client check local", 3 ); + $CHECKS .= ' local'; + $CHECKFUNCS{'local'} = \&check_local; + } } __END__ -- 2.30.2