about summary refs log tree commit homepage
path: root/cmogstored.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmogstored.c')
-rw-r--r--cmogstored.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/cmogstored.c b/cmogstored.c
index 72400de..35b08f9 100644
--- a/cmogstored.c
+++ b/cmogstored.c
@@ -357,14 +357,23 @@ static void siginit(void (*wakeup_handler)(int))
         CHECK(int, 0, sigaction(SIGURG, &sa, NULL));
 
         sa.sa_handler = wakeup_handler;
+
+        /* TERM and INT are graceful shutdown for now, no immediate shutdown */
         CHECK(int, 0, sigaction(SIGTERM, &sa, NULL));
         CHECK(int, 0, sigaction(SIGINT, &sa, NULL));
 
-        /* TODO: graceful shutdown, upgrade, reload */
-        CHECK(int, 0, sigaction(SIGQUIT, &sa, NULL));
+        CHECK(int, 0, sigaction(SIGQUIT, &sa, NULL)); /* graceful shutdown */
+        CHECK(int, 0, sigaction(SIGUSR1, &sa, NULL)); /* no-op, nginx compat */
+        CHECK(int, 0, sigaction(SIGUSR2, &sa, NULL)); /* upgrade */
+
+        /*
+         * SIGWINCH/SIGHUP are no-ops for now to allow reuse of nginx init
+         * scripts.  We should support them in the future.
+         * SIGWINCH will disable new connections and drop idlers
+         * SIGHUP will reenable new connections/idlers after SIGWINCH
+         */
+        CHECK(int, 0, sigaction(SIGWINCH, &sa, NULL));
         CHECK(int, 0, sigaction(SIGHUP, &sa, NULL));
-        CHECK(int, 0, sigaction(SIGUSR1, &sa, NULL));
-        CHECK(int, 0, sigaction(SIGUSR2, &sa, NULL));
 
         sa.sa_flags = SA_NOCLDSTOP;
         CHECK(int, 0, sigaction(SIGCHLD, &sa, NULL));