5b2912a
From: Peter Lemenkov <lemenkov@redhat.com>
5b2912a
Date: Fri, 15 Jul 2016 16:01:08 +0200
369b335
Subject: [PATCH] Use proto_dist from command line
369b335
369b335
Use protocol distribution value from command line when provided instead
369b335
of always using default value (inet_tcp) when trying to check epmd.
369b335
369b335
If provided more than one protocol distribution types, then use the
369b335
first one.
5b2912a
5b2912a
Signed-off-by: Peter Lemenkov <lemenkov@redhat.com>
5b2912a
8f6ae34
diff --git a/src/rabbit_nodes_common.erl b/src/rabbit_nodes_common.erl
1d1d3c2
index e773bf6..1cbe1a4 100644
8f6ae34
--- a/src/rabbit_nodes_common.erl
8f6ae34
+++ b/src/rabbit_nodes_common.erl
1d1d3c2
@@ -80,9 +80,14 @@ do_ensure_epmd(false, Prog) ->
1d1d3c2
     rabbit_log:error("ensure_epmd: unable to find executable '~s' in PATH: '~s'", [Prog, Path]);
1d1d3c2
 do_ensure_epmd(Exe, _) ->
5b2912a
     ID = rabbit_misc:random(1000000000),
369b335
+    ProtoDist = case init:get_argument(proto_dist) of
369b335
+            {ok, [Proto | _Protos]} -> Proto;
369b335
+            error -> "inet_tcp"
369b335
+    end,
5b2912a
     Port = open_port(
1d1d3c2
              {spawn_executable, Exe},
5b2912a
              [{args, ["-sname", rabbit_misc:format("epmd-starter-~b", [ID]),
5b2912a
+                      "-proto_dist", rabbit_misc:format("~p", [ProtoDist]),
5b2912a
                       "-noshell", "-eval", "halt()."]},
5b2912a
               exit_status, stderr_to_stdout, use_stdio]),
5b2912a
     port_shutdown_loop(Port).