From: Willy Tarreau Date: Sat, 27 Feb 2016 07:26:14 +0000 (+0100) Subject: MINOR: systemd: ensure a reload doesn't mask a stop X-Git-Tag: v1.7-dev2~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3aa9e6840fa0bc7a74f3cab7400dcb33ad4537a;p=thirdparty%2Fhaproxy.git MINOR: systemd: ensure a reload doesn't mask a stop 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. --- diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c index 0c076a6a41..d118ec6ffe 100644 --- a/src/haproxy-systemd-wrapper.c +++ b/src/haproxy-systemd-wrapper.c @@ -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 */