]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: cfgparse: 'daemon' not compatible with -Ws
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 5 Nov 2025 10:45:36 +0000 (11:45 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 5 Nov 2025 10:49:11 +0000 (11:49 +0100)
Emit a warning when the 'daemon' keyword is used in master-worker mode
for systemd (-Ws). This never worked and was always ignored by setting
MODE_FOREGROUND during cmdline parsing.

src/cfgparse-global.c

index bbd45a2df3b3843a0fe1f8a6c86faa58b991ed9b..28442c1b0d2c3f982d389850175c672a2be3bd91 100644 (file)
@@ -995,7 +995,11 @@ static int cfg_parse_global_mode(char **args, int section_type,
                return -1;
 
        if (strcmp(args[0], "daemon") == 0) {
-               global.mode |= MODE_DAEMON;
+               if (global.tune.options & GTUNE_USE_SYSTEMD) {
+                       ha_warning("'%s' is not compatible with -Ws (master-worker mode for systemd), ignoring.\n", args[0]);
+               } else {
+                       global.mode |= MODE_DAEMON;
+               }
 
        } else if (strcmp(args[0], "quiet") == 0) {
                global.mode |= MODE_QUIET;