From ea37940f12a9298f2fe23920911d911ec66e0e7d Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Tue, 14 Mar 2000 22:26:23 +0000 Subject: [PATCH] the current status is written to $0 in the mail loop --- src/spong-client.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } } -- 2.30.2