diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-10-17 14:40:39 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-10-17 14:40:39 +0100 |
| commit | 1780ff7927707c6424d857833b1931259b914901 (patch) | |
| tree | 863fdba36bd64d26ca638fe12579bc77525c03ca /src | |
| parent | 383a64375102048030863b00dbc6e19253f75e6d (diff) | |
| download | rabbitmq-server-git-1780ff7927707c6424d857833b1931259b914901.tar.gz | |
Add RABBITMQ_USE_LONGNAME. Based on a patch from Marcos Diez but with fixes for the new way rabbitmqctl starts distribution, refactoring of common stuff into rabbitmq-env, not trimming the hostname, etc.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_control_main.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index afc2caa0cc..6e789e3756 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -586,7 +586,7 @@ exit_loop(Port) -> start_distribution() -> CtlNodeName = rabbit_misc:format("rabbitmqctl-~s", [os:getpid()]), - {ok, _} = net_kernel:start([list_to_atom(CtlNodeName), shortnames]). + {ok, _} = net_kernel:start([list_to_atom(CtlNodeName), name_type()]). become(BecomeNode) -> case net_adm:ping(BecomeNode) of @@ -594,12 +594,18 @@ become(BecomeNode) -> pang -> io:format(" * Impersonating node: ~s...", [BecomeNode]), error_logger:tty(false), ok = net_kernel:stop(), - {ok, _} = net_kernel:start([BecomeNode, shortnames]), + {ok, _} = net_kernel:start([BecomeNode, name_type()]), io:format(" done~n", []), Dir = mnesia:system_info(directory), io:format(" * Mnesia directory : ~s~n", [Dir]) end. +name_type() -> + case os:getenv("RABBITMQ_USE_LONGNAME") of + "true" -> longnames; + _ -> shortnames + end. + %%---------------------------------------------------------------------------- default_if_empty(List, Default) when is_list(List) -> |
