When using the external-check command option HAProxy was failing to
start with a fatal error "'external-check' cannot handle unexpected
argument". When looking at the code it was looking for an incorrect
argument. Also correcting an Alert message text as spotted by by
PiBa-NL.


diff --git a/src/cfgparse.c b/src/cfgparse.c
index 71d3fea..5d72240 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -3350,9 +3350,9 @@ int cfg_parse_listen(const char *file, int
linenum, char **args, int kwm)
                 }

                if (!strcmp(args[1], "command")) {
-                       if (alertif_too_many_args(1, file, linenum,
args, &err_code))
+                       if (alertif_too_many_args(2, file, linenum,
args, &err_code))
                                goto out;
-                       if (*(args[1]) == 0) {
+                       if (*(args[2]) == 0) {
                                Alert("parsing [%s:%d] : missing
argument after '%s'.\n",
                                      file, linenum, args[1]);
                                err_code |= ERR_ALERT | ERR_FATAL;
@@ -3362,9 +3362,9 @@ int cfg_parse_listen(const char *file, int
linenum, char **args, int kwm)
                        curproxy->check_command = strdup(args[2]);
                }
                else if (!strcmp(args[1], "path")) {
-                       if (alertif_too_many_args(1, file, linenum,
args, &err_code))
+                       if (alertif_too_many_args(2, file, linenum,
args, &err_code))
                                goto out;
-                       if (*(args[1]) == 0) {
+                       if (*(args[2]) == 0) {
                                Alert("parsing [%s:%d] : missing
argument after '%s'.\n",
                                      file, linenum, args[1]);
                                err_code |= ERR_ALERT | ERR_FATAL;
@@ -7330,7 +7330,7 @@ int check_config_validity()
                                clear = 1;
                        }
                        if (curproxy->check_command[0] != '/' &&
!curproxy->check_path) {
-                               Alert("Proxy '%s': '%s' does not have
a leading '/' and 'external-command path' is not set.\n",
+                               Alert("Proxy '%s': '%s' does not have
a leading '/' and 'external-check path' is not set.\n",
                                      curproxy->id, "external-check command");
                                cfgerr++;
                        }

Thanks,

Ben


-- 
LOADBALANCER.ORG LTD.
www.loadbalancer.org
[email protected]

Reply via email to