my $n = 0;
foreach my $s (values %$dmap) {
- if ($s->can('busy') && $s->busy) {
+ $s->can('busy') or next;
+ if ($s->busy) {
++$n;
} else {
# close as much as possible, early as possible
exit if $quit++;
kill_workers($s);
} elsif ($s eq 'WINCH') {
- $worker_processes = 0;
+ if ($daemonize) {
+ $worker_processes = 0;
+ } else {
+ warn
+"ignoring SIGWINCH since we are not daemonized\n";
+ $SIG{WINCH} = 'IGNORE';
+ }
} elsif ($s eq 'HUP') {
$worker_processes = $set_workers;
kill_workers($s);
$SIG{QUIT} = $SIG{INT} = $SIG{TERM} = *worker_quit;
$SIG{USR1} = *reopen_logs;
$SIG{HUP} = $refresh;
+ $SIG{CHLD} = 'DEFAULT';
+ $SIG{$_} = 'IGNORE' for qw(USR2 TTIN TTOU WINCH);
# this calls epoll_create:
@listeners = map {
PublicInbox::Listener->new($_, $post_accept)