]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: startup: 'haproxy -c' is quiet when valid
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 9 Nov 2023 13:48:50 +0000 (14:48 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 13 Nov 2023 08:59:34 +0000 (09:59 +0100)
MODE_CHECK does not output "Configuration file is valid" by default
anymore. To display this message the -V option must be used with -c.

However the warning and errors are still output by default if they
exist.

This allows to clean the output of the systemd unit file with is doing a
-c.

src/haproxy.c

index 363cbdab27517ed064a91f5df4a7d3e4174e2b61..b37677ff6d1dca71d2c994eb7a0d9c4a275732fa 100644 (file)
@@ -2375,7 +2375,8 @@ static void init(int argc, char **argv)
 
                if (pr || px) {
                        /* At least one peer or one listener has been found */
-                       qfprintf(stdout, "Configuration file is valid\n");
+                       if (global.mode & MODE_VERBOSE)
+                               qfprintf(stdout, "Configuration file is valid\n");
                        deinit_and_exit(0);
                }
                qfprintf(stdout, "Configuration file has no error but will not start (no listener) => exit(2).\n");