]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mworker: don't reuse PIDs passed to the master
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 20 Jun 2017 09:20:33 +0000 (11:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:43:28 +0000 (14:43 +0200)
When starting the master worker with -sf or -st, the PIDs will be reused
on the next reload, which is a problem if new processes on the system
took those PIDs.

This patch ensures that we don't register old PIDs in the reload system
when launching the master worker.

src/haproxy.c

index cdb6066b5a9d42a2d5b916ccdc8eb7d65d8aedc6..a42574433411f88f7c8d256114256baf15265740 100644 (file)
@@ -2444,6 +2444,13 @@ int main(int argc, char **argv)
        if (nb_oldpids)
                nb_oldpids = tell_old_pids(oldpids_sig);
 
+       if ((getenv("HAPROXY_MWORKER_REEXEC") == NULL)) {
+               nb_oldpids = 0;
+               free(oldpids);
+               oldpids = NULL;
+       }
+
+
        /* Note that any error at this stage will be fatal because we will not
         * be able to restart the old pids.
         */