Hi Willy, I have another small request concerning this multiple configuration files parameters : when an error is detected in one of the files, then haproxy displays "Error(s) found in configuration file : ..." for all the following ones, even if they're valid.
In haproxy.c, I suggest to use local variable you added last week, this will then display the message when needed : http://haproxy.1wt.eu/git?p=haproxy-1.3.git;a=commit;h=d289240085a5aaed6f403c9512008ccf16fab0a6 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -543,7 +543,15 @@ void init(int argc, char **argv) init_default_instance(); for (i = 0; i < cfg_nbcfgfiles; i++) { - err_code |= readcfgfile(cfg_cfgfile[i]); + int ret; + + ret = readcfgfile(cfg_cfgfile[i]); + if (ret == -1) { + Alert("Could not open configuration file %s : %s\n", + cfg_cfgfile[i], strerror(errno)); + exit(1); + } + err_code |= ret; if (err_code & (ERR_ABORT|ERR_FATAL)) Alert("Error(s) found in configuration file : %s\n", cfg_cfgfile[i]); if (err_code & ERR_ABORT) The first test next to the modification could be : if (ret & (ERR_ABORT|ERR_FATAL)) Alert("Error(s) found in configuration file : %s\n", cfg_cfgfile[i]); Nothing really important but it can save a little time when this error occurs :) -- Cyril Bonté

