diff --git a/reg-tests/mcli/mcli_start_progs.vtc b/reg-tests/mcli/mcli_start_progs.vtc index c812288e01..489efff7ee 100644 --- a/reg-tests/mcli/mcli_start_progs.vtc +++ b/reg-tests/mcli/mcli_start_progs.vtc @@ -9,6 +9,8 @@ server s1 { } -start haproxy h1 -W -S -conf { + global + expose-deprecated-directives defaults mode http timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" diff --git a/src/mworker-prog.c b/src/mworker-prog.c index 88ff1fc9f8..6aa9ec8ce8 100644 --- a/src/mworker-prog.c +++ b/src/mworker-prog.c @@ -194,9 +194,15 @@ int cfg_parse_program(const char *file, int linenum, char **args, int kwm) goto error; } - ha_warning("parsing [%s:%d]: The '%s' section is deprecated and will eventually be removed, please consider " - "using a process manager instead, such as sysvinit, systemd, supervisord or s6\n", - file, linenum, args[0]); + if (!deprecated_directives_allowed) { + ha_warning("parsing [%s:%d]: The 'program' section is deprecated and will be eventually removed, " + "it can be still allowed by setting 'expose-deprecated-directives' keyword in the 'global' " + "section defined before any 'program' section. Please, consider to use a process manager instead " + "of 'program' section, such as sysvinit, systemd, supervisord or s6.\n", + file, linenum); + err_code |= ERR_ALERT | ERR_ABORT; + goto error; + } LIST_APPEND(&proc_list, &ext_child->list);