--nodaemonize options.
Before, --nodaemonize wasn't being passed to the re-execed spong-*.
# History:
# (1) Ported bb-local.sh script to perl. (Ed Hill Feb 26, 1997)
#
-# $Id: spong-client.pl,v 1.18 2001/06/19 21:24:32 supermathie Exp $
+# $Id: spong-client.pl,v 1.19 2001/06/20 17:10:22 supermathie Exp $
use lib '@@LIBDIR@@';
&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", $debug; } else { exec $me; }
- exit(0);
+ if( $debug ) { push(@args, "--debug", $debug); }
+ if( $nodaemonize ) { push(@args, "--nodaemonize"); }
+ exec $me, @args or die "Couldn't exec $me after HUP";
}
sub pipe_handler {
# (2) Converted checks to new plugin mechanism (Stephen Johnson May 28, 1999)
# Added user-configurable escalation mechanism
#
-# $Id: spong-network.pl,v 1.38 2001/06/19 21:24:32 supermathie Exp $
+# $Id: spong-network.pl,v 1.39 2001/06/20 17:10:22 supermathie Exp $
use Carp;
use lib "@@LIBDIR@@";
&debug( "caught HUP signal, restarting..." );
unlink "$SPONGTMP/spong-network.pid" if "$SPONGTMP/spong-network.pid";
alarm(0);
- if( $debug ) { exec $me, "--debug", $debug; } else { exec $me; }
+ @args = ($me);
+ if( $debug ) { push(@args, "--debug", $debug); }
+ if( $nodaemonize ) { push(@args, "--nodaemonize"); }
+ exec $me, @args or die "Couldn't exec $me after HUP";
}
sub pipe_handler {
# There are one or more update processes that listen for status updates
# from client programs.
-# $Id: spong-server.pl,v 1.43 2001/06/19 21:28:02 supermathie Exp $
+# $Id: spong-server.pl,v 1.44 2001/06/20 17:10:22 supermathie Exp $
use lib "@@LIBDIR@@";
# kill QUIT,$bb_pid; waitpid($bb_pid,0);
unlink "$SPONGTMP/spong-server.pid" if -f "$SPONGTMP/spong-server.pid";
close( SERVER );
- if( $debug ) { exec $me, "--debug", $debug; } else { exec $me; }
+ if( $debug ) { push(@args, "--debug", $debug); }
+ if( $nodaemonize ) { push(@args, "--nodaemonize"); }
+ exec $me, @args or die "Couldn't exec $me after HUP";
}
# If the child process dies for some reason, then we restart it.