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:
parent
ab6dd83b6c
commit
03c2bf7608
3
Changes
3
Changes
@ -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: exit codes cleanup (based on patch by Diego d'Ambra)
|
||||||
|
|
||||||
prefork: detect and reset locked shared memory (based on patch by
|
prefork: detect and reset locked shared memory (based on patch by
|
||||||
|
@ -226,15 +226,18 @@ sub run {
|
|||||||
|
|
||||||
# prevent another signal and disable reaper
|
# prevent another signal and disable reaper
|
||||||
$SIG{$sig} = $SIG{CHLD} = $SIG{HUP} = 'IGNORE';
|
$SIG{$sig} = $SIG{CHLD} = $SIG{HUP} = 'IGNORE';
|
||||||
unlink($pid_file) if $pid_file;
|
|
||||||
|
|
||||||
# close socket
|
# close socket
|
||||||
$d->close();
|
$d->close();
|
||||||
my $cnt = kill 'INT' => keys %children;
|
|
||||||
|
|
||||||
# cleanup shared memory
|
# send signal to process group
|
||||||
|
kill $sig, -$$;
|
||||||
|
|
||||||
|
# cleanup
|
||||||
IPC::Shareable->clean_up;
|
IPC::Shareable->clean_up;
|
||||||
info("shutdown of daemon (and $cnt children)");
|
unlink($pid_file) if $pid_file;
|
||||||
|
|
||||||
|
info("shutdown of daemon");
|
||||||
exit;
|
exit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user