diff options
| author | Hubert Plociniczak <hubert@lshift.net> | 2008-09-11 14:10:14 +0100 |
|---|---|---|
| committer | Hubert Plociniczak <hubert@lshift.net> | 2008-09-11 14:10:14 +0100 |
| commit | 8f209a026e329308c855313a6957e4830bc846b0 (patch) | |
| tree | 10299a9216c7778072cd238cf3276ebce2e9f452 /src | |
| parent | 131d39c9cb519a4fb90cca04bdc71721a47a4679 (diff) | |
| download | rabbitmq-server-git-8f209a026e329308c855313a6957e4830bc846b0.tar.gz | |
Added status command to rabbit_mutli, init.d scripts
now use that command.
Used status command in init.d scripts to check
if the server is running before stopping it.
Fixed various indentation problems in init.d scripts.
Synchronized the init.d in Debian and RPM to behave
in a similar way.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_multi.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rabbit_multi.erl b/src/rabbit_multi.erl index 2b11771770..9373e8cb1d 100644 --- a/src/rabbit_multi.erl +++ b/src/rabbit_multi.erl @@ -70,6 +70,7 @@ usage() -> Available commands: start_all <NodeCount> - start a local cluster of RabbitMQ nodes. + status - print status of all running nodes stop_all - stops all local RabbitMQ nodes. rotate_logs [Suffix] - rotate logs for all local and running RabbitMQ nodes. "), @@ -88,6 +89,17 @@ action(start_all, [NodeCount], RpcTimeout) -> false -> timeout end; +action(status, [], RpcTimeout) -> + io:format("Status of all running nodes...~n", []), + call_all_nodes( + fun({Node, Pid}) -> + io:format("Node '~p' with Pid ~p: ", [Node, Pid]), + case rpc:call(Node, rabbit, status, [], RpcTimeout) of + {badrpc, Error} -> io:format("~p~n", [Error]); + [{running_applications, Apps} | _] -> io:format("~p~n", [Apps]) + end + end); + action(stop_all, [], RpcTimeout) -> io:format("Stopping all nodes...~n", []), call_all_nodes(fun({Node, Pid}) -> |
