defect 4284 - fixed xcatd attempt to write to broken pipe which caused DB processes to not get killed

This commit is contained in:
mellor 2014-10-14 20:48:22 -04:00
parent c85c5acdee
commit 2511cebef8

View File

@ -280,6 +280,7 @@ my $socket;
$SIG{USR2} = sub {
if ($socket) { #do not mess with pid file except when we still have the socket.
unlink("/var/run/xcat/installservice.pid"); close($socket); $quit=1;
$udpctl=0;
xCAT::MsgUtils->message("S","xcatd install monitor $$ quiescing");
}
};
@ -619,6 +620,7 @@ sub do_udp_service { #This function opens up a UDP port
if ($socket) {
#only clear out pid file when we still have socket.
unlink("/var/run/xcat/udpservice.pid"); close($socket); $quit=1; $socket=0;
$udpctl=0;
xCAT::MsgUtils->message("S","xcatd udp service $$ quiescing");
}
kill(15,$discopid);
@ -864,7 +866,9 @@ sub ssl_reaper {
$numdone--;
}
}
store_fd({clientcountchange=>$numdone,sslclientcount=>$sslclients},$udpctl); #notify udp service of how many clients are active
if ($udpctl) {
store_fd({clientcountchange=>$numdone,sslclientcount=>$sslclients},$udpctl); #notify udp service of how many clients are active
}
$SIG{CHLD} = \&ssl_reaper;
}
@ -930,7 +934,7 @@ if (! defined $pid_UDP) {
die;
}
unless ($pid_UDP) {
close($udpctl);
close($udpctl); $udpctl=0;
$$progname="xcatd: UDP listener";
my $pid_disco;
my $discoctl;
@ -961,7 +965,7 @@ if (! defined $pid_MON) {
}
unless ($pid_MON) {
$$progname="xcatd: install monitor";
close($udpctl);
close($udpctl); $udpctl=0;
do_installm_service;
xexit(0);
}
@ -1010,6 +1014,7 @@ my $mainpidfile;
$SIG{USR2} = sub {
if ($listener) {
unlink("/var/run/xcat/mainservice.pid"); close($listener); $quit=1; $listener=0;
$udpctl=0;
xCAT::MsgUtils->message("S","xcatd main service $$ quiescing");
}
};
@ -1124,7 +1129,7 @@ until ($quit) {
}
if ($child == 0) {
close($udpctl);
close($udpctl); $udpctl=0;
$SIG{TERM} = $SIG{INT} = {};
$SIG{CHLD} = \&generic_reaper; #THROTTLE
$listener->close;
@ -1205,7 +1210,9 @@ if ($inet6support) {
xexit(0);
}
$sslclients++; #THROTTLE
store_fd({clientcountchange=>1,sslclientcount=>$sslclients},$udpctl); #notify udp service of how many clients are active
if ($udpctl) {
store_fd({clientcountchange=>1,sslclientcount=>$sslclients},$udpctl); #notify udp service of how many clients are active
}
$cnnection->close();
}
if (open($mainpidfile,"<","/var/run/xcat/mainservice.pid")) {