summaryrefslogtreecommitdiff
path: root/wait_node
diff options
context:
space:
mode:
Diffstat (limited to 'wait_node')
-rwxr-xr-xwait_node21
1 files changed, 21 insertions, 0 deletions
diff --git a/wait_node b/wait_node
new file mode 100755
index 0000000000..e4549b5c13
--- /dev/null
+++ b/wait_node
@@ -0,0 +1,21 @@
+#!/usr/bin/env escript
+%% -*- erlang -*-
+%%! -sname wait_node -pa ./ebin
+
+main([NodeStr, PidFile]) ->
+ case {code:load_file(rabbit_misc), code:load_file(rabbit_nodes)} of
+ {{module, _}, {module, _}} ->
+ ok;
+ _ ->
+ io:format("Compile with 'make' before running this script~n")
+ end,
+ Node = rabbit_nodes:make(NodeStr),
+ Pid = rabbit_misc:read_pid_file(PidFile, true),
+ io:format("pid is ~s~n", [Pid]),
+ rabbit_misc:wait_for_application(Node, Pid, kernel);
+main(_) ->
+ usage().
+
+usage() ->
+ io:format("Usage: ./wait_node node pidfile~n"),
+ halt(1).