From 78cf2586c2e9d7f8e7a77c24ccca3d054ab9d0a6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 26 Mar 2023 10:52:46 +0000 Subject: watch: do not recreate signalfd on SIGHUP The normal method by which PublicInbox::DS::event_loop sets up signals once needs some coercing to work with -watch. Otherwise, we'll end up wasting FDs every time somebody reloads -watch via SIGHUP. --- script/public-inbox-watch | 1 + 1 file changed, 1 insertion(+) (limited to 'script') diff --git a/script/public-inbox-watch b/script/public-inbox-watch index 4c50461f..2fb27343 100755 --- a/script/public-inbox-watch +++ b/script/public-inbox-watch @@ -27,6 +27,7 @@ my $reload = sub { $watch->quit; $watch = PublicInbox::Watch->new(PublicInbox::Config->new); if ($watch) { + $watch->{sig} = $prev->{sig}; # prevent redundant signalfd warn "# reloaded\n"; } else { warn("E: reloading failed\n"); -- cgit v1.2.3-24-ge0c7