summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2015-11-17 15:37:39 +0300
committerMichael Klishin <michael@clojurewerkz.org>2015-11-17 15:37:39 +0300
commit8928a29b43322e6dee9f3b5a6e9b546a93047a89 (patch)
tree80dc562389c1d3ca4efd6e3b6be3acdf63976869
parent5931edc27eb3273945345dc3f9a784287df88ccd (diff)
parent52ce9fa48c596424a39059d13aad3c3183d42cee (diff)
downloadrabbitmq-server-git-8928a29b43322e6dee9f3b5a6e9b546a93047a89.tar.gz
Merge branch 'master' into rabbitmq-server-351
-rw-r--r--packaging/windows-exe/rabbitmq_nsi.in22
-rwxr-xr-xscripts/rabbitmq-server-ha.ocf11
-rw-r--r--src/rabbit_control_main.erl16
-rw-r--r--src/rabbit_mirror_queue_slave.erl20
4 files changed, 49 insertions, 20 deletions
diff --git a/packaging/windows-exe/rabbitmq_nsi.in b/packaging/windows-exe/rabbitmq_nsi.in
index 7ad711ba38..7aec1f1dc4 100644
--- a/packaging/windows-exe/rabbitmq_nsi.in
+++ b/packaging/windows-exe/rabbitmq_nsi.in
@@ -4,6 +4,7 @@
!include WinMessages.nsh
!include FileFunc.nsh
!include WordFunc.nsh
+!include x64.nsh
!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!define uninstall "Software\Microsoft\Windows\CurrentVersion\Uninstall\RabbitMQ"
@@ -19,8 +20,10 @@ OutFile "rabbitmq-server-%%VERSION%%.exe"
; Icons
!define MUI_ICON "rabbitmq.ico"
-; The default installation directory
-InstallDir "$PROGRAMFILES\RabbitMQ Server"
+; The default installation directory is empty. The .onInit function
+; below takes care of selecting the appropriate (32-bit vs. 64-bit)
+; "Program Files".
+InstallDir ""
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
@@ -86,9 +89,9 @@ Section "RabbitMQ Server (required)" Rabbit
WriteRegStr HKLM "SOFTWARE\VMware, Inc.\RabbitMQ Server" "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
- WriteRegStr HKLM ${uninstall} "DisplayName" "RabbitMQ Server"
+ WriteRegStr HKLM ${uninstall} "DisplayName" "RabbitMQ Server %%VERSION%%"
WriteRegStr HKLM ${uninstall} "UninstallString" "$INSTDIR\uninstall.exe"
- WriteRegStr HKLM ${uninstall} "DisplayIcon" "$INSTDIR\uninstall.exe,0"
+ WriteRegStr HKLM ${uninstall} "DisplayIcon" "$INSTDIR\rabbitmq.ico"
WriteRegStr HKLM ${uninstall} "Publisher" "Pivotal Software, Inc."
WriteRegStr HKLM ${uninstall} "DisplayVersion" "%%VERSION%%"
WriteRegDWORD HKLM ${uninstall} "NoModify" 1
@@ -168,6 +171,7 @@ Section "Uninstall"
RMDir /r "$INSTDIR\rabbitmq_server-%%VERSION%%"
Delete "$INSTDIR\rabbitmq.ico"
Delete "$INSTDIR\uninstall.exe"
+ RMDir "$INSTDIR"
; Remove start menu items
RMDir /r "$SMPROGRAMS\RabbitMQ Server"
@@ -182,6 +186,16 @@ SectionEnd
; Functions
Function .onInit
+ ; By default, always install in "\Program Files", not matter if we run
+ ; on a 32-bit or 64-bit Windows.
+ ${If} $INSTDIR == "";
+ ${If} ${RunningX64}
+ StrCpy $INSTDIR "$PROGRAMFILES64\RabbitMQ Server"
+ ${Else}
+ StrCpy $INSTDIR "$PROGRAMFILES\RabbitMQ Server"
+ ${EndIf}
+ ${EndIf}
+
Call findErlang
ReadRegStr $0 HKLM ${uninstall} "UninstallString"
diff --git a/scripts/rabbitmq-server-ha.ocf b/scripts/rabbitmq-server-ha.ocf
index 42e5332367..1e4ebd0f1e 100755
--- a/scripts/rabbitmq-server-ha.ocf
+++ b/scripts/rabbitmq-server-ha.ocf
@@ -36,6 +36,7 @@ OCF_RESKEY_definitions_dump_file_default="/etc/rabbitmq/definitions"
OCF_RESKEY_pid_file_default="/var/run/rabbitmq/pid"
OCF_RESKEY_log_dir_default="/var/log/rabbitmq"
OCF_RESKEY_mnesia_base_default="/var/lib/rabbitmq/mnesia"
+OCF_RESKEY_host_ip_default="127.0.0.1"
OCF_RESKEY_node_port_default=5672
OCF_RESKEY_erlang_cookie_default=false
OCF_RESKEY_erlang_cookie_file_default="/var/lib/rabbitmq/.erlang.cookie"
@@ -217,6 +218,14 @@ Base directory for storing Mnesia files
<content type="boolean" default="${OCF_RESKEY_mnesia_base_default}" />
</parameter>
+<parameter name="host_ip" unique="0" required="0">
+<longdesc lang="en">
+${OCF_RESKEY_binary} should listen on this IP address
+</longdesc>
+<shortdesc lang="en">${OCF_RESKEY_binary} should listen on this IP address</shortdesc>
+<content type="boolean" default="${OCF_RESKEY_host_ip_default}" />
+</parameter>
+
<parameter name="node_port" unique="0" required="0">
<longdesc lang="en">
${OCF_RESKEY_binary} should listen on this port
@@ -1607,7 +1616,7 @@ action_notify() {
ocf_log info "${LH} post-start end."
if [ -s "${OCF_RESKEY_definitions_dump_file}" ] ; then
ocf_log info "File ${OCF_RESKEY_definitions_dump_file} exists"
- ocf_run curl -X POST -u $OCF_RESKEY_admin_user:$OCF_RESKEY_admin_password 127.0.0.1:15672/api/definitions --header "Content-Type:application/json" -d @$OCF_RESKEY_definitions_dump_file
+ ocf_run curl -X POST -u $OCF_RESKEY_admin_user:$OCF_RESKEY_admin_password $OCF_RESKEY_host_ip:15672/api/definitions --header "Content-Type:application/json" -d @$OCF_RESKEY_definitions_dump_file
rc=$?
if [ $rc -eq $OCF_SUCCESS ] ; then
ocf_log info "RMQ definitions have imported succesfully."
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl
index 2799d510d0..5d061252d0 100644
--- a/src/rabbit_control_main.erl
+++ b/src/rabbit_control_main.erl
@@ -769,8 +769,20 @@ call(Node, {Mod, Fun, Args}, InfoKeys, ToBinUtf8, Timeout) ->
true -> lists:map(fun list_to_binary_utf8/1, Args);
false -> Args
end,
- spawn_link(rabbit_cli, rpc_call, [Node, Mod, Fun, Args0, Ref = make_ref(),
- Pid = self(), Timeout]),
+ Ref = make_ref(),
+ Pid = self(),
+ spawn_link(
+ fun () ->
+ case rabbit_cli:rpc_call(Node, Mod, Fun, Args0,
+ Ref, Pid, Timeout) of
+ {error, _} = Error ->
+ Pid ! {error, Error};
+ {bad_argument, _} = Error ->
+ Pid ! {error, Error};
+ _ ->
+ ok
+ end
+ end),
rabbit_control_misc:wait_for_info_messages(
Pid, Ref, InfoKeys, fun display_info_message/2, Timeout).
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index d0c566b811..225c21dd54 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -256,13 +256,10 @@ handle_cast({gm, Instruction}, State) ->
handle_cast({deliver, Delivery = #delivery{sender = Sender, flow = Flow}, true},
State) ->
%% Asynchronous, non-"mandatory", deliver mode.
- case Flow of
- %% We are acking messages to the channel process that sent us
- %% the message delivery. See
- %% rabbit_amqqueue_process:handle_ch_down for more info.
- flow -> credit_flow:ack(Sender);
- noflow -> ok
- end,
+ %% We are acking messages to the channel process that sent us
+ %% the message delivery. See
+ %% rabbit_amqqueue_process:handle_ch_down for more info.
+ maybe_flow_ack(Sender, Flow),
noreply(maybe_enqueue_message(Delivery, State));
handle_cast({sync_start, Ref, Syncer},
@@ -658,10 +655,7 @@ promote_me(From, #state { q = Q = #amqqueue { name = QName },
%% need to send an ack for these messages since the channel is waiting
%% for one for the via-GM case and we will not now receive one.
promote_delivery(Delivery = #delivery{sender = Sender, flow = Flow}) ->
- case Flow of
- flow -> credit_flow:ack(Sender);
- noflow -> ok
- end,
+ maybe_flow_ack(Sender, Flow),
Delivery#delivery{mandatory = false}.
noreply(State) ->
@@ -955,8 +949,8 @@ process_instruction({set_queue_mode, Mode},
BQS1 = BQ:set_queue_mode(Mode, BQS),
{ok, State #state { backing_queue_state = BQS1 }}.
-maybe_flow_ack(ChPid, flow) -> credit_flow:ack(ChPid);
-maybe_flow_ack(_ChPid, noflow) -> ok.
+maybe_flow_ack(Sender, flow) -> credit_flow:ack(Sender);
+maybe_flow_ack(_Sender, noflow) -> ok.
msg_ids_to_acktags(MsgIds, MA) ->
{AckTags, MA1} =