]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: cli: leave the RMAINT state when setting an IP address on the CLI
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Nov 2016 17:21:32 +0000 (18:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 9 Nov 2016 14:30:47 +0000 (15:30 +0100)
The RMAINT state happens when a server doesn't get a valid DNS response
past the hold time. If the address is forced on the CLI, we must use it
and leave the RMAINT state.

src/dumpstats.c

index e18b9ba7561ead012b76ea638caa1a8ab5b25d2a..491b0fe67f8ca86a5e2b4bb922ba249de07136de 100644 (file)
@@ -1806,7 +1806,7 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
                                char *addr = NULL;
                                char *port = NULL;
                                if (strlen(args[4]) == 0) {
-                                       appctx->ctx.cli.msg = "set server <b>/<s> requires an <addr> .\n";
+                                       appctx->ctx.cli.msg = "set server <b>/<s> addr requires an address and optionally a port.\n";
                                        appctx->st0 = STAT_CLI_PRINT;
                                        return 1;
                                }
@@ -1821,6 +1821,7 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
                                        appctx->ctx.cli.msg = warning;
                                        appctx->st0 = STAT_CLI_PRINT;
                                }
+                               srv_clr_admin_flag(sv, SRV_ADMF_RMAINT);
                        }
                        else {
                                appctx->ctx.cli.msg = "'set server <srv>' only supports 'agent', 'health', 'state', 'weight', 'addr' and 'check-port'.\n";