From 52880f97b9635c62d197ed50424380f24733cb04 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 15 Dec 2018 13:30:03 +0100 Subject: [PATCH] MINOR: mworker/cli: indicate in the master prompt when a reload failed If a reload was issued to the master process and failed, it is critical that the admin sees it because it means that the saved configuration does not work anymore and might not be usable after a full restart. For this reason in this case we modify the "master" prompt to explicitly indicate that a reload failed. --- doc/management.txt | 7 +++++++ src/cli.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/management.txt b/doc/management.txt index ff98b74989..21719f475b 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -2538,6 +2538,13 @@ In this example, the master has been reloaded 5 times but one of the old worker is still running and survived 3 reloads. You could access the CLI of this worker to understand what's going on. +When the prompt is enabled (via the "prompt" command), the context the CLI is +working on is displayed in the prompt. The master is identified by the "master" +string, and other processes are identified with their PID. In case the last +reload failed, the master prompt will be changed to "master[ReloadFailed]>" so +that it becomes visible that the process is still running on the previous +configuration and that the new configuration is not operational. + The master CLI uses a special prefix notation to access the multiple processes. This notation is easily identifiable as it begins by a @. diff --git a/src/cli.c b/src/cli.c index d75955d15f..1a2253c492 100644 --- a/src/cli.c +++ b/src/cli.c @@ -1718,7 +1718,8 @@ void pcli_write_prompt(struct stream *s) chunk_appendf(msg, "+ "); } else { if (s->pcli_next_pid == 0) - chunk_appendf(msg, "master> "); + chunk_appendf(msg, "master%s> ", + (global.mode & MODE_MWORKER_WAIT) ? "[ReloadFailed]" : ""); else chunk_appendf(msg, "%d> ", s->pcli_next_pid); }