2011-12-19 Ramon Novoa <rnovoa@artica.es>
* pandora_agent: Wait for broker childs instead of ignoring SIGCHLD. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5282 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a7e635d83a
commit
25ab1c12c1
|
@ -1,3 +1,8 @@
|
|||
2011-12-19 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* pandora_agent: Wait for broker childs instead of ignoring
|
||||
SIGCHLD.
|
||||
|
||||
2011-12-19 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* pandora_agent: Ignore SIGCHLD.
|
||||
|
|
|
@ -114,7 +114,7 @@ my $ConfDir = '';
|
|||
my $ConfFile = 'pandora_agent.conf';
|
||||
|
||||
# Broker agent configuration files
|
||||
my @BrokerConfFiles;
|
||||
my @BrokerPid;
|
||||
|
||||
# Configuration tokens
|
||||
my %Conf = (
|
||||
|
@ -1589,9 +1589,6 @@ sub kill_signal_handler (){
|
|||
#Handler TERM signal.
|
||||
$SIG{'TERM'} = \&kill_signal_handler;
|
||||
|
||||
# Ignore SIGCHLD
|
||||
$SIG{'CHLD'} = 'IGNORE';
|
||||
|
||||
# Check command line arguments
|
||||
print_usage unless ($#ARGV == 0);
|
||||
$ConfDir = fix_directory ($ARGV[0]);
|
||||
|
@ -1719,6 +1716,8 @@ while (1) {
|
|||
|
||||
# Execute
|
||||
last;
|
||||
} else {
|
||||
push (@BrokerPid, $main_agent);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1851,6 +1850,9 @@ while (1) {
|
|||
|
||||
# Sleep if main agent
|
||||
if ($main_agent != 0) {
|
||||
foreach my $broker_pid (@BrokerPid) {
|
||||
waitpid ($broker_pid, 0);
|
||||
}
|
||||
sleep ($Conf{'interval'});
|
||||
}
|
||||
# Finish if broker agent
|
||||
|
|
Loading…
Reference in New Issue