1 From: Peter Lemenkov <lemenkov@redhat.com>
2 Date: Fri, 15 Jul 2016 16:01:08 +0200
3 Subject: [PATCH] Use proto_dist from command line
5 Use protocol distribution value from command line when provided instead
6 of always using default value (inet_tcp) when trying to check epmd.
8 If provided more than one protocol distribution types, then use the
11 Signed-off-by: Peter Lemenkov <lemenkov@redhat.com>
13 diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl
14 index 70a5355..18f7714 100644
15 --- a/src/rabbit_nodes.erl
16 +++ b/src/rabbit_nodes.erl
17 @@ -221,9 +221,14 @@ set_cluster_name(Name) ->
19 {ok, Prog} = init:get_argument(progname),
20 ID = rabbit_misc:random(1000000000),
21 + ProtoDist = case init:get_argument(proto_dist) of
22 + {ok, [Proto | _Protos]} -> Proto;
26 {spawn_executable, os:find_executable(Prog)},
27 [{args, ["-sname", rabbit_misc:format("epmd-starter-~b", [ID]),
28 + "-proto_dist", rabbit_misc:format("~p", [ProtoDist]),
29 "-noshell", "-eval", "halt()."]},
30 exit_status, stderr_to_stdout, use_stdio]),
31 port_shutdown_loop(Port).