]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: mworker: -W is mandatory when using -S
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 9 Nov 2023 14:02:13 +0000 (15:02 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 9 Nov 2023 14:07:15 +0000 (15:07 +0100)
Defining a master CLI without the master-worker mode emits a warning
since version 1.8. This patch enforce the behavior by forbiding the
usage of the -S option without the master-worker mode.

src/haproxy.c

index 7a4f49fa69058088ef2ded75d2fdbdc36f5eafd8..363cbdab27517ed064a91f5df4a7d3e4174e2b61 100644 (file)
@@ -2250,7 +2250,8 @@ static void init(int argc, char **argv)
        }
 
        if (!LIST_ISEMPTY(&mworker_cli_conf) && !(arg_mode & MODE_MWORKER)) {
-               ha_warning("a master CLI socket was defined, but master-worker mode (-W) is not enabled.\n");
+               ha_alert("a master CLI socket was defined, but master-worker mode (-W) is not enabled.\n");
+               exit(EXIT_FAILURE);
        }
 
        /* destroy unreferenced defaults proxies  */