prefork: improve shutdown of parent (and children) on very busy systems

To improve the shutdown of parent and children, send the exiting signal
 to the process group (maybe %children is not up to date on very busy
 systems).

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@943 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Diego d'Ambra 2008-09-04 11:43:52 +00:00 committed by Ask Bjørn Hansen
parent ab6dd83b6c
commit 03c2bf7608
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,6 @@
prefork: improve shutdown of parent (and children) on very busy
systems (Diego d'Ambra)
prefork: exit codes cleanup (based on patch by Diego d'Ambra)
prefork: detect and reset locked shared memory (based on patch by

View File

@ -226,15 +226,18 @@ sub run {
# prevent another signal and disable reaper
$SIG{$sig} = $SIG{CHLD} = $SIG{HUP} = 'IGNORE';
unlink($pid_file) if $pid_file;
# close socket
$d->close();
my $cnt = kill 'INT' => keys %children;
# cleanup shared memory
# send signal to process group
kill $sig, -$$;
# cleanup
IPC::Shareable->clean_up;
info("shutdown of daemon (and $cnt children)");
unlink($pid_file) if $pid_file;
info("shutdown of daemon");
exit;
};