summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerhard Lazu <gerhard@lazu.co.uk>2017-03-31 12:05:49 +0100
committerGerhard Lazu <gerhard@lazu.co.uk>2017-03-31 12:05:49 +0100
commitb529c77862bd2ddcd8c29a2540819f935f3ea65d (patch)
tree1e872387d04a81318af843e19fbb03d670c96fac
parentd2eb76a52c913b6f181f24ba13b7c315e4e0af83 (diff)
downloadrabbitmq-server-git-b529c77862bd2ddcd8c29a2540819f935f3ea65d.tar.gz
Add more info during rabbitmqctl shutdown
We want to know at which shutdown stage the command is at, and get confirmation of successful shutdown. Inform is used all over the place, is it OK to remove " ..." from all rabbitmqctl commands that use it? [#142699191]
-rw-r--r--src/rabbit_control_main.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl
index e1d77306cb..15d941b7b2 100644
--- a/src/rabbit_control_main.erl
+++ b/src/rabbit_control_main.erl
@@ -156,7 +156,7 @@ start() ->
Inform = case Quiet of
true -> fun (_Format, _Args1) -> ok end;
false -> fun (Format, Args1) ->
- io:format(Format ++ " ...~n", Args1)
+ io:format(Format ++ "~n", Args1)
end
end,
try
@@ -271,10 +271,12 @@ do_action(Command, Node, Args, Opts, Inform, Timeout) ->
end.
shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform) ->
- Inform("Shutting down RabbitMQ node ~p running at PID ~p", [Node, Pid]),
Res = call(Node, {rabbit, stop_and_halt, []}),
case Res of
- ok -> wait_for_process_death(Pid);
+ ok ->
+ Inform("Waiting for PID ~s to terminate", [Pid]),
+ wait_for_process_death(Pid),
+ Inform("RabbitMQ node running at PID ~s successfully shut down", [Pid]);
_ -> ok
end,
Res.
@@ -282,6 +284,7 @@ shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform) ->
action(shutdown, Node, [], _Opts, Inform) ->
case rpc:call(Node, os, getpid, []) of
Pid when is_list(Pid) ->
+ Inform("Shutting down RabbitMQ node ~p running at PID ~s", [Node, Pid]),
shutdown_node_and_wait_pid_to_stop(Node, Pid, Inform);
Error -> Error
end;