From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C63B32070E for ; Wed, 6 Jul 2016 07:14:37 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 02/10] daemon: disable USR2/TTIN/TTOU/WINCH in workers Date: Wed, 6 Jul 2016 07:14:27 +0000 Message-Id: <20160706071435.18143-3-e@80x24.org> In-Reply-To: <20160706071435.18143-1-e@80x24.org> References: <20160706071435.18143-1-e@80x24.org> List-Id: If using a master/worker setup, a careless user could be trying to signal all processes using "killall". This may trigger bad side-effects; but try to limit the side-effects as much as possible. --- lib/PublicInbox/Daemon.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 512bb20..7849f9c 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -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) -- EW