Better child kill.
This commit is contained in:
parent
dd1d7c783f
commit
590b56e610
@ -16,6 +16,7 @@ use Cualsea::Server::MonitorController;
|
||||
my $pid = fork;
|
||||
if ($pid) {{
|
||||
local $SIG{INT} = \&finish_parent;
|
||||
local $SIG{TERM} = \&finish_parent;
|
||||
while (1) {
|
||||
my $loop = Cualsea::Server::Loop->new;
|
||||
try {
|
||||
@ -33,7 +34,7 @@ while (1) {
|
||||
}
|
||||
|
||||
sub finish_parent {
|
||||
kill 'INT', $pid;
|
||||
kill 'KILL', $pid;
|
||||
1 while waitpid $pid, WNOHANG;
|
||||
exit;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user