We do not want to be accepting connections during graceful
shutdown because another new process is likely taking over.
This also allows us to free up the listener case another
(independent) process wants to claim it.
# killing again terminates immediately:
exit unless @listeners;
+ $_->close foreach @listeners; # call Danga::Socket::close
@listeners = ();
# give slow clients 30s to finish reading/writing whatever
$SIG{USR1} = *reopen_logs;
$SIG{HUP} = $refresh;
# this calls epoll_create:
- PublicInbox::Listener->new($_, $post_accept) for @listeners;
+ @listeners = map {
+ PublicInbox::Listener->new($_, $post_accept)
+ } @listeners;
Danga::Socket->EventLoop;
$parent_pipe = undef;
}