[server] For SIGHUP processing, don't send the TCP server SIGTERM unless it is running

This commit is contained in:
Michael Rash
2015-11-01 01:58:47 -08:00
parent d3dcfc9cf4
commit 2f49be6cb0
3 changed files with 9 additions and 4 deletions
+2
View File
@@ -1,5 +1,7 @@
fwknop-2.6.8 (11//2015):
- [server] open/close functionality...
- [server] Bug fix to not send the TCP server a TERM signal even when it is
not running when fwknopd receives a HUP signal.
fwknop-2.6.7 (08/24/2015):
- [server] When command execution is enabled with ENABLE_CMD_EXEC for an
+2 -1
View File
@@ -556,7 +556,8 @@ static int handle_signals(fko_srv_options_t *opts)
{
log_msg(LOG_WARNING, "Got SIGHUP. Re-reading configs.");
free_configs(opts);
kill(opts->tcp_server_pid, SIGTERM);
if(opts->tcp_server_pid > 0)
kill(opts->tcp_server_pid, SIGTERM);
usleep(1000000);
got_sighup = 0;
rv = 0; /* this means fwknopd will not exit */
+5 -3
View File
@@ -320,6 +320,7 @@ my $NO_SERVER_RECEIVE_CHECK = 2;
my $APPEND_RESULTS = 1;
my $NO_APPEND_RESULTS = 2;
my %sigs = (
'SIGHUP' => 1,
'SIGINT' => 2,
'SIGUSR1' => 10,
'SIGUSR2' => 12,
@@ -2190,8 +2191,8 @@ sub server_start_stop_cycle() {
### send additional signals for code coverage
if (-e $default_pid_file) {
sleep 1;
for my $sig ($sigs{'SIGINT'}, $sigs{'SIGUSR1'},
$sigs{'SIGUSR2'}) {
for my $sig ($sigs{'SIGHUP'}, $sigs{'SIGINT'},
$sigs{'SIGUSR1'}, $sigs{'SIGUSR2'}) {
&run_cmd("$lib_view_str $valgrind_str $fwknopdCmd $default_server_conf_args -R",
$cmd_out_tmp, $curr_test_file);
sleep 1;
@@ -2210,7 +2211,8 @@ sub server_start_stop_cycle() {
$cmd_out_tmp, $curr_test_file);
### now send the signals against a non-daemon fwknopd process
for my $sig ($sigs{'SIGINT'}, $sigs{'SIGUSR1'}, $sigs{'SIGUSR2'}) {
for my $sig ($sigs{'SIGHUP'}, $sigs{'SIGINT'},
$sigs{'SIGUSR1'}, $sigs{'SIGUSR2'}) {
&do_fwknopd_cmd("$lib_view_str $valgrind_str " .
"$fwknopdCmd $default_server_conf_args -f");