]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: systemd: ensure a reload doesn't mask a stop
authorWilly Tarreau <w@1wt.eu>
Sat, 27 Feb 2016 07:26:14 +0000 (08:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 27 Feb 2016 07:28:43 +0000 (08:28 +0100)
If a SIGHUP/SIGUSR2 is sent immediately after a SIGTERM/SIGINT and
before wait() is notified, it will mask it since there's no queue,
only a copy of the last received signal. Let's add a special check
before overwriting the signal so that SIGTERM/SIGINT are not masked.

src/haproxy-systemd-wrapper.c

index 0c076a6a41e21104e8ab19ed2b39f32a1bb897bf..d118ec6ffed9ab854ac8e2dab27cf3c1bc4b7156 100644 (file)
@@ -123,7 +123,8 @@ static int read_pids(char ***pid_strv)
 
 static void signal_handler(int signum)
 {
-       caught_signal = signum;
+       if (caught_signal != SIGINT && caught_signal != SIGTERM)
+               caught_signal = signum;
 }
 
 /* handles SIGUSR2 and SIGHUP only */