]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Daemon.pm
view: introduce WwwStream interface
[public-inbox.git] / lib / PublicInbox / Daemon.pm
index 3d895b0912cc2e7c574b89d2f3a33cb5fedb7663..b76b9ffbf91ac944518aa72d43ed43bcde618174 100644 (file)
@@ -375,7 +375,13 @@ sub master_loop {
                                exit if $quit++;
                                kill_workers($s);
                        } elsif ($s eq 'WINCH') {
-                               $worker_processes = 0;
+                               if (-t STDIN || -t STDOUT || -t STDERR) {
+                                       warn
+"ignoring SIGWINCH while connected to terminal\n";
+                                       $SIG{WINCH} = 'IGNORE';
+                               } else {
+                                       $worker_processes = 0;
+                               }
                        } elsif ($s eq 'HUP') {
                                $worker_processes = $set_workers;
                                kill_workers($s);
@@ -442,6 +448,7 @@ 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);
        # this calls epoll_create:
        @listeners = map {
                PublicInbox::Listener->new($_, $post_accept)