summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-07-15 11:00:12 +0100
committerSimon MacMullen <simon@rabbitmq.com>2011-07-15 11:00:12 +0100
commit9d9cf8321a391bab73c69d4f5be9259221973d62 (patch)
tree5c9033d6f81b953fe9dc5724e13e97be10399dbe
parent03c3179a14ec08295f59432e0641eb475f665688 (diff)
downloadrabbitmq-server-9d9cf8321a391bab73c69d4f5be9259221973d62.tar.gz
Show when we've acquired the pid. This would be useful for diagnostics.
-rw-r--r--src/rabbit_control.erl12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index 101155bb..ebc1ce54 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -192,7 +192,7 @@ action(force_cluster, Node, ClusterNodeSs, _Opts, Inform) ->
action(wait, Node, [PidFile], _Opts, Inform) ->
Inform("Waiting for ~p", [Node]),
- wait_for_application(Node, PidFile);
+ wait_for_application(Node, PidFile, Inform);
action(status, Node, [], _Opts, Inform) ->
Inform("Status of node ~p", [Node]),
@@ -353,15 +353,17 @@ action(report, Node, _Args, _Opts, Inform) ->
%%----------------------------------------------------------------------------
-wait_for_application(Node, PidFile) ->
- wait_for_application0(Node, wait_and_read_pid_file(PidFile)).
+wait_for_application(Node, PidFile, Inform) ->
+ Pid = wait_and_read_pid_file(PidFile),
+ Inform("pid is ~s", [Pid]),
+ wait_for_application(Node, Pid).
-wait_for_application0(Node, Pid) ->
+wait_for_application(Node, Pid) ->
case node_up(Node) of
true -> ok;
false -> case pid_up(Pid) of
true -> timer:sleep(1000),
- wait_for_application0(Node, Pid);
+ wait_for_application(Node, Pid);
false -> {error, {pid_went_away, Pid}}
end
end.