diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-17 16:36:15 +0100 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-17 16:36:15 +0100 |
| commit | 23a307737d08f94e8bc2ecd92b4e1d52716456e0 (patch) | |
| tree | 20ce9a9af4059dbcdf846bff440607b064acedf4 /wait_node | |
| parent | 5d56d9ff1082f7a3264e5d8535568dae7a544f1b (diff) | |
| download | rabbitmq-server-git-23a307737d08f94e8bc2ecd92b4e1d52716456e0.tar.gz | |
Added wait_node script to wait for the node to be up.
Diffstat (limited to 'wait_node')
| -rwxr-xr-x | wait_node | 21 |
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). |
