make sure to kill child if parent exits for any unknown reason

This commit is contained in:
Jordi Sanfeliu 2013-02-26 12:42:32 +01:00
parent b63e0412b3
commit 5191c2f562
1 changed files with 4 additions and 6 deletions

View File

@ -418,7 +418,7 @@ $0 = sprintf("%s %s%s%s%s",
$options{d} ? " -d $options{d}" : "", $options{d} ? " -d $options{d}" : "",
$options{v} ? " -v" : ""); $options{v} ? " -v" : "");
daemonize(); #daemonize();
logger("Starting Monitorix version " . VERSION . " (pid $$)."); logger("Starting Monitorix version " . VERSION . " (pid $$).");
if($options{p}) { if($options{p}) {
@ -496,13 +496,11 @@ foreach (split(',', $config{graph_name} . ", traffacct")) {
} }
} }
# XXX
#use Data::Dumper;
#print Dumper($config{func_update});
# XXX
if(!scalar($config{func_update})) { if(!scalar($config{func_update})) {
logger("nothing to do, exiting."); logger("nothing to do, exiting.");
if(lc($config{httpd_builtin}->{enabled} eq "y")) {
kill(15, $config{httpd_pid});
}
exit(0); exit(0);
} }