From 0315edcf7b46ecf57a9088b4e10c204706cce0fb Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Fri, 3 Mar 2000 03:10:19 +0000 Subject: [PATCH] added code to handle_signals() to clear out signal mask to clean any blocked sigs --- src/spong-client.pl | 7 ++++++- src/spong-network.pl | 6 ++++++ src/spong-server.pl | 6 ++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/spong-client.pl b/src/spong-client.pl index e4fd188..f9268ce 100755 --- a/src/spong-client.pl +++ b/src/spong-client.pl @@ -98,7 +98,12 @@ sub load_config_files { # signal the current running spong-server program. sub handle_signals { - + + # Clear out signal mask in case we inherit any blocked sigs + + my $sigset = POSIX::SigSet->new; + sigprocmask(SIG_SETMASK, $sigset ); + # Set up some signal handlers to handle our death gracefully, and also # listen for the HUP signal, and if we se that, we re-exec ourself. diff --git a/src/spong-network.pl b/src/spong-network.pl index 52ba2f9..a779901 100755 --- a/src/spong-network.pl +++ b/src/spong-network.pl @@ -25,6 +25,7 @@ $CRIT_WARN_LEVEL = 1; use Sys::Hostname; use Net::Ping; use Socket; +use POSIX; use Spong::Daemon; use Spong::Status qw(status); @@ -258,6 +259,11 @@ sub load_config_files { sub handle_signals { + # Clear out signal mask in case we inherit any blocked sigs + + my $sigset = POSIX::SigSet->new; + sigprocmask(SIG_SETMASK, $sigset ); + # Set up some signal handlers to handle our death gracefully, and also # listen for the HUP signal, and if we se that, we re-exec ourself. diff --git a/src/spong-server.pl b/src/spong-server.pl index 61026a4..39cfe15 100755 --- a/src/spong-server.pl +++ b/src/spong-server.pl @@ -29,6 +29,7 @@ use File::Path; use Socket; use Config; use IO::Socket; +use POSIX; if( $ARGV[0] eq "--debug" ) { $debug = 1; shift; } if( $ARGV[0] eq "--restart" ) { $restart = 1; shift; } @@ -772,6 +773,11 @@ sub load_config_files { sub handle_signals { + # Clear out signal mask in case we inherit any blocked sigs + + my $sigset = POSIX::SigSet->new; + sigprocmask(SIG_SETMASK, $sigset ); + # Set up some signal handlers to handle our death gracefully, and also # listen for the HUP signal, and if we see that, we re-exec ourself. -- 2.30.2