]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: init: don't stop proxies in parent process when exiting
authorWilly Tarreau <w@1wt.eu>
Fri, 1 May 2015 15:01:08 +0000 (17:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 May 2015 18:15:06 +0000 (20:15 +0200)
That's pointless, and that's confusing when debugging.

src/haproxy.c

index 5822a8bfc7edc464394baed9524d779ca249b7ab..b5144a7fd66838d2f75d9fa86944fc73bbc0c759 100644 (file)
@@ -1780,6 +1780,15 @@ int main(int argc, char **argv)
                free(global.chroot);  global.chroot = NULL;
                free(global.pidfile); global.pidfile = NULL;
 
+               if (proc == global.nbproc) {
+                       if (global.mode & MODE_SYSTEMD) {
+                               protocol_unbind_all();
+                               for (proc = 0; proc < global.nbproc; proc++)
+                                       while (waitpid(children[proc], NULL, 0) == -1 && errno == EINTR);
+                       }
+                       exit(0); /* parent must leave */
+               }
+
                /* we might have to unbind some proxies from some processes */
                px = proxy;
                while (px != NULL) {
@@ -1790,15 +1799,6 @@ int main(int argc, char **argv)
                        px = px->next;
                }
 
-               if (proc == global.nbproc) {
-                       if (global.mode & MODE_SYSTEMD) {
-                               protocol_unbind_all();
-                               for (proc = 0; proc < global.nbproc; proc++)
-                                       while (waitpid(children[proc], NULL, 0) == -1 && errno == EINTR);
-                       }
-                       exit(0); /* parent must leave */
-               }
-
                free(children);
                children = NULL;
                /* if we're NOT in QUIET mode, we should now close the 3 first FDs to ensure