From: Stephen L Johnson Date: Tue, 14 Mar 2000 22:26:23 +0000 (+0000) Subject: the current status is written to $0 in the mail loop X-Git-Tag: spong-2_7-alpha5~36 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea37940f12a9298f2fe23920911d911ec66e0e7d;p=spong.git the current status is written to $0 in the mail loop --- diff --git a/src/spong-client.pl b/src/spong-client.pl index 04b9193..cd891d0 100755 --- a/src/spong-client.pl +++ b/src/spong-client.pl @@ -23,6 +23,8 @@ use Spong::Daemon; use Spong::Status qw(status); use Spong::Log; +$0 = "spong-client"; # Change the ps arguments section early + srand( time() ^ ($$ + ($$ << 15 )) ); $debug = $restart = $kill = $nosleep = 0; @@ -64,12 +66,11 @@ Spong::Daemon::Daemonize # Daemonize if not signalling or debugging # Pretty simple program, check the stuff that we are looking at, report it to # the server, sleep, and do it all again... -$0 = "spong-client"; - while( 1 ) { my ($check); foreach $check (split / /,$CHECKS) { + $0 = "spong-client (checking $check)"; eval { &{$CHECKFUNCS{$check}}(); }; if ($@) { &error( "Error running check $check: $@") }; } @@ -84,6 +85,7 @@ while( 1 ) { my $sleep = int($SPONGSLEEP - (.05 * $SPONGSLEEP) + rand(.1 * $SPONGSLEEP)); &debug( "sleeping for $sleep seconds" ); + $0 = "spong-client (sleeping)"; sleep $sleep; } }