about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-06-24 22:26:28 +0000
committerEric Wong <e@80x24.org>2017-06-26 03:44:35 +0000
commit8b0359338d1ec1e0ec7521c77b35f878931f4cd6 (patch)
tree4c0424a1e7cb130c5f5b1d36bf8023357315286a /script
parentf9b70eb6ebbf96c2fe79ab2738ea4954c5a124f3 (diff)
downloadpublic-inbox-8b0359338d1ec1e0ec7521c77b35f878931f4cd6.tar.gz
This should be more reliable and safer as it'll ensure
existing fast-import instances are shut down properly.
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-watch4
1 files changed, 4 insertions, 0 deletions
diff --git a/script/public-inbox-watch b/script/public-inbox-watch
index 51f1baa2..0d1cd831 100755
--- a/script/public-inbox-watch
+++ b/script/public-inbox-watch
@@ -17,6 +17,10 @@ if ($watch_md) {
         $SIG{HUP} = $reload;
         $SIG{USR1} = $scan;
         $SIG{ALRM} = sub { $SIG{ALRM} = 'DEFAULT'; $scan->() };
+        $SIG{QUIT} = $SIG{TERM} = $SIG{INT} = sub {
+                $watch_md->quit if $watch_md;
+                $watch_md = undef;
+        };
         alarm(1);
         $watch_md->watch while ($watch_md);
 }