]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Daemon.pm
wwwstream: allow undef noop callback
[public-inbox.git] / lib / PublicInbox / Daemon.pm
index a25dd90fa407e81ac1a430474ee4779d7563c5d5..7849f9c0aecd4fa581bcbdcb4c6fe9fa40caad19 100644 (file)
@@ -376,12 +376,12 @@ sub master_loop {
                                exit if $quit++;
                                kill_workers($s);
                        } elsif ($s eq 'WINCH') {
-                               if (-t STDIN || -t STDOUT || -t STDERR) {
+                               if ($daemonize) {
+                                       $worker_processes = 0;
+                               } else {
                                        warn
-"ignoring SIGWINCH while connected to terminal\n";
+"ignoring SIGWINCH since we are not daemonized\n";
                                        $SIG{WINCH} = 'IGNORE';
-                               } else {
-                                       $worker_processes = 0;
                                }
                        } elsif ($s eq 'HUP') {
                                $worker_processes = $set_workers;
@@ -449,7 +449,8 @@ sub daemon_loop ($$) {
        $SIG{QUIT} = $SIG{INT} = $SIG{TERM} = *worker_quit;
        $SIG{USR1} = *reopen_logs;
        $SIG{HUP} = $refresh;
-       $SIG{$_} = 'DEFAULT' for qw(CHLD USR2 TTIN TTOU WINCH);
+       $SIG{CHLD} = 'DEFAULT';
+       $SIG{$_} = 'IGNORE' for qw(USR2 TTIN TTOU WINCH);
        # this calls epoll_create:
        @listeners = map {
                PublicInbox::Listener->new($_, $post_accept)