Skip to content

Commit d1c6d44

Browse files
committed
BUG/MINOR: startup: don't fork worker if started with -c -W
Don't do master-worker fork if MODE_CHECK is detected from the command line along with the master-worker mode. We should exit in MODE_CHECK, after the configuration parsing and validation. So, with the new master-worker architecture it's better to align this mode with the standalone. This patch does not need to be backported, as related to the latest master-worker rework.
1 parent f0f03b9 commit d1c6d44

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/haproxy.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,6 +3150,12 @@ static void read_cfg_in_discovery_mode(int argc, char **argv)
31503150
ha_alert("a master CLI socket was defined, but master-worker mode (-W) is not enabled.\n");
31513151
exit(EXIT_FAILURE);
31523152
}
3153+
3154+
/* in MODE_CHECK and in MODE_DUMP_CFG we just need to parse the
3155+
* configuration and exit, see step_init_2()
3156+
*/
3157+
if ((global.mode & MODE_MWORKER) && (global.mode & (MODE_CHECK | MODE_DUMP_CFG)))
3158+
global.mode &= ~MODE_MWORKER;
31533159
}
31543160

31553161
void deinit(void)

0 commit comments

Comments
 (0)