From 2fb6b0150b8a8fc49385d21d7fd1f8a1deff5ebf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 5 Jul 2016 13:05:41 +0000 Subject: daemon: disable USR2/TTIN/TTOU/WINCH in workers 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(-) (limited to 'lib/PublicInbox') diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 512bb208..7849f9c0 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) -- cgit v1.2.3-24-ge0c7