From 369b335220fb093ba32cc6ae9ed7d12399002b80 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Jul 17 2016 14:03:28 +0000 Subject: Improve proto_dist usage patch Signed-off-by: Peter Lemenkov --- diff --git a/rabbitmq-common-0002-Use-proto_dist-from-command-line.patch b/rabbitmq-common-0002-Use-proto_dist-from-command-line.patch new file mode 100644 index 0000000..a923a28 --- /dev/null +++ b/rabbitmq-common-0002-Use-proto_dist-from-command-line.patch @@ -0,0 +1,31 @@ +From: Peter Lemenkov +Date: Fri, 15 Jul 2016 16:01:08 +0200 +Subject: [PATCH] Use proto_dist from command line + +Use protocol distribution value from command line when provided instead +of always using default value (inet_tcp) when trying to check epmd. + +If provided more than one protocol distribution types, then use the +first one. + +Signed-off-by: Peter Lemenkov + +diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl +index 70a5355..18f7714 100644 +--- a/src/rabbit_nodes.erl ++++ b/src/rabbit_nodes.erl +@@ -221,9 +221,14 @@ set_cluster_name(Name) -> + ensure_epmd() -> + {ok, Prog} = init:get_argument(progname), + ID = rabbit_misc:random(1000000000), ++ ProtoDist = case init:get_argument(proto_dist) of ++ {ok, [Proto | _Protos]} -> Proto; ++ error -> "inet_tcp" ++ end, + Port = open_port( + {spawn_executable, os:find_executable(Prog)}, + [{args, ["-sname", rabbit_misc:format("epmd-starter-~b", [ID]), ++ "-proto_dist", rabbit_misc:format("~p", [ProtoDist]), + "-noshell", "-eval", "halt()."]}, + exit_status, stderr_to_stdout, use_stdio]), + port_shutdown_loop(Port). diff --git a/rabbitmq-common-0002-Use-proto_dist-from-config-instead-of-always-using-d.patch b/rabbitmq-common-0002-Use-proto_dist-from-config-instead-of-always-using-d.patch deleted file mode 100644 index f8c3496..0000000 --- a/rabbitmq-common-0002-Use-proto_dist-from-config-instead-of-always-using-d.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Peter Lemenkov -Date: Fri, 15 Jul 2016 16:01:08 +0200 -Subject: [PATCH] Use proto_dist from config instead of always using default - (inet_tcp) - -Signed-off-by: Peter Lemenkov - -diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl -index 70a5355..6bfce23 100644 ---- a/src/rabbit_nodes.erl -+++ b/src/rabbit_nodes.erl -@@ -221,9 +221,11 @@ set_cluster_name(Name) -> - ensure_epmd() -> - {ok, Prog} = init:get_argument(progname), - ID = rabbit_misc:random(1000000000), -+ ProtoDist = application:get_env(kernel, proto_dist, inet_tcp), - Port = open_port( - {spawn_executable, os:find_executable(Prog)}, - [{args, ["-sname", rabbit_misc:format("epmd-starter-~b", [ID]), -+ "-proto_dist", rabbit_misc:format("~p", [ProtoDist]), - "-noshell", "-eval", "halt()."]}, - exit_status, stderr_to_stdout, use_stdio]), - port_shutdown_loop(Port). diff --git a/rabbitmq-server.spec b/rabbitmq-server.spec index f7fbb1e..c1c4b72 100644 --- a/rabbitmq-server.spec +++ b/rabbitmq-server.spec @@ -5,7 +5,7 @@ Name: rabbitmq-server Version: 3.6.3 -Release: 2%{?dist} +Release: 3%{?dist} License: MPLv1.1 Group: Development/Libraries Source0: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.xz @@ -22,7 +22,7 @@ Patch3: rabbitmq-server-0003-Revert-Distinct-exit-codes-for-CLI-utilities.patch Patch4: rabbitmq-server-0004-Allow-guest-login-from-non-loopback-connections.patch Patch5: rabbitmq-server-0005-Avoid-RPC-roundtrips-in-list-commands.patch Patch101: rabbitmq-common-0001-Avoid-RPC-roundtrips-while-listing-items.patch -Patch102: rabbitmq-common-0002-Use-proto_dist-from-config-instead-of-always-using-d.patch +Patch102: rabbitmq-common-0002-Use-proto_dist-from-command-line.patch URL: http://www.rabbitmq.com/ BuildArch: noarch @@ -181,6 +181,9 @@ done %changelog +* Sun Jul 17 2016 Peter Lemenkov - 3.6.3-3 +- Improve proto_dist usage patch + * Fri Jul 15 2016 Peter Lemenkov - 3.6.3-2 - Avoid RPC roundtrips in list commands - Use proto_dist from config instead of always using default (inet_tcp)