]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: startup: reintroduce program support
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Wed, 9 Oct 2024 21:11:36 +0000 (23:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
This patch is a part of series to reintroduce the program support in the new
master-worker architecture.

Let's add here mworker_ext_launch_all() call before master-worker fork to
start external programs. We keep the order and the place of these two forks
(program and master-worker) the same as before the refactoring, in order to
avoid regressions.

src/haproxy.c

index b934850cf29762cb7eb625fd673b8b755e9e5b84..d88d5fa27cdf7c68a8cc48c2f6e711c991c29f5b 100644 (file)
@@ -3751,9 +3751,13 @@ int main(int argc, char **argv)
        if ((global.mode & MODE_DAEMON || global.mode & MODE_MWORKER) && global.pidfile != NULL)
                handle_pidfile();
 
-       /* Master-worker fork */
-       if (global.mode & MODE_MWORKER)
+       /* Master-worker and program forks */
+       if (global.mode & MODE_MWORKER) {
+               /* fork and run binary from command keyword in program section */
+               mworker_ext_launch_all();
+               /* fork worker */
                apply_master_worker_mode();
+       }
 
        /* Worker, daemon, foreground modes read the rest of the config */
        if (!master) {