diff options
author | Jerry Kuch <jerryk@vmware.com> | 2011-09-13 09:17:09 -0700 |
---|---|---|
committer | Jerry Kuch <jerryk@vmware.com> | 2011-09-13 09:17:09 -0700 |
commit | 98ff0baab78e942aa9b3f73fd10f21724971abb2 (patch) | |
tree | debbcf02264160507e642952279663523fe1edc0 /src/rabbit.erl | |
parent | f2412e2f4af51dcdb8c5998595ba49e42979cb77 (diff) | |
parent | 6a5a56ea911e68f739f2759139c4dc0a93230cba (diff) | |
download | rabbitmq-server-98ff0baab78e942aa9b3f73fd10f21724971abb2.tar.gz |
Merge bug 23056
Diffstat (limited to 'src/rabbit.erl')
-rw-r--r-- | src/rabbit.erl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 20b3e275..3e311747 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -18,7 +18,8 @@ -behaviour(application). --export([prepare/0, start/0, stop/0, stop_and_halt/0, status/0, environment/0, +-export([prepare/0, start/0, stop/0, stop_and_halt/0, status/0, + is_running/0 , is_running/1, environment/0, rotate_logs/1, force_event_refresh/0]). -export([start/2, stop/1]). @@ -196,6 +197,8 @@ {os, {atom(), atom()}} | {erlang_version, string()} | {memory, any()}]). +-spec(is_running/0 :: () -> boolean()). +-spec(is_running/1 :: (node()) -> boolean()). -spec(environment/0 :: () -> [{atom() | term()}]). -spec(log_location/1 :: ('sasl' | 'kernel') -> log_location()). @@ -241,11 +244,19 @@ stop_and_halt() -> status() -> [{pid, list_to_integer(os:getpid())}, - {running_applications, application:which_applications()}, + {running_applications, application:which_applications(infinity)}, {os, os:type()}, {erlang_version, erlang:system_info(system_version)}, {memory, erlang:memory()}]. +is_running() -> is_running(node()). + +is_running(Node) -> + case rpc:call(Node, application, which_applications, [infinity]) of + {badrpc, _} -> false; + Apps -> proplists:is_defined(rabbit, Apps) + end. + environment() -> lists:keysort( 1, [P || P = {K, _} <- application:get_all_env(rabbit), |