]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mworker: wait again for signals when execvp fail
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 15 Nov 2017 18:02:56 +0000 (19:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 15 Nov 2017 18:52:06 +0000 (19:52 +0100)
After execvp fails, the signals were ignored, preventing to try a reload
again. It is now fixed by reaching the top of the mworker_wait()
function once the execvp failed.

src/haproxy.c

index 28811a84f9f2a75bfa8a4436fed15a455bc0d6ed..b90e2540ba9b48e6e51d8e6d851c6cc06660cdfb 100644 (file)
@@ -670,6 +670,8 @@ static void mworker_wait()
        int exitpid = -1;
        int status = 0;
 
+restart_wait:
+
        mworker_register_signals();
        mworker_unblock_signals();
 
@@ -679,6 +681,8 @@ static void mworker_wait()
                        int sig = caught_signal;
                        if (sig == SIGUSR2 || sig == SIGHUP) {
                                mworker_reload();
+                               /* should reach there only if it fail */
+                               goto restart_wait;
                        } else {
                                Warning("Exiting Master process...\n");
                                mworker_kill(sig);