summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2017-04-05 15:17:48 +0300
committerMichael Klishin <mklishin@pivotal.io>2017-04-05 15:17:48 +0300
commit32e4955c5a6cdd829795c69e1fbfff9901eeb01e (patch)
tree0567fc9665da7dd1381c6884c377ba282f432e9e
parent14e2906bf37a3b87ab54021a5e40cbee796994b2 (diff)
parenta706a2ba08c16ba518a49844114e15bb41119846 (diff)
downloadrabbitmq-server-git-32e4955c5a6cdd829795c69e1fbfff9901eeb01e.tar.gz
Merge branch 'master' into rabbitmq-server-1143
-rw-r--r--.gitignore1
-rw-r--r--README.md2
-rw-r--r--docs/rabbitmqctl.1.xml22
-rw-r--r--src/background_gc.erl2
-rw-r--r--src/dtree.erl2
-rw-r--r--src/file_handle_cache.erl2
-rw-r--r--src/file_handle_cache_stats.erl2
-rw-r--r--src/gatherer.erl2
-rw-r--r--src/gm.erl2
-rw-r--r--src/mnesia_sync.erl2
-rw-r--r--src/rabbit.erl5
-rw-r--r--src/rabbit_access_control.erl2
-rw-r--r--src/rabbit_alarm.erl2
-rw-r--r--src/rabbit_amqqueue_process.erl2
-rw-r--r--src/rabbit_amqqueue_sup.erl2
-rw-r--r--src/rabbit_amqqueue_sup_sup.erl2
-rw-r--r--src/rabbit_auth_mechanism_amqplain.erl2
-rw-r--r--src/rabbit_auth_mechanism_cr_demo.erl2
-rw-r--r--src/rabbit_auth_mechanism_plain.erl2
-rw-r--r--src/rabbit_autoheal.erl2
-rw-r--r--src/rabbit_binding.erl2
-rw-r--r--src/rabbit_channel_sup.erl2
-rw-r--r--src/rabbit_channel_sup_sup.erl2
-rw-r--r--src/rabbit_cli.erl2
-rw-r--r--src/rabbit_client_sup.erl2
-rw-r--r--src/rabbit_connection_helper_sup.erl2
-rw-r--r--src/rabbit_connection_sup.erl2
-rw-r--r--src/rabbit_control_pbe.erl2
-rw-r--r--src/rabbit_credential_validation.erl2
-rw-r--r--src/rabbit_credential_validator.erl2
-rw-r--r--src/rabbit_credential_validator_accept_everything.erl2
-rw-r--r--src/rabbit_credential_validator_min_password_length.erl2
-rw-r--r--src/rabbit_credential_validator_password_regexp.erl2
-rw-r--r--src/rabbit_dead_letter.erl2
-rw-r--r--src/rabbit_diagnostics.erl2
-rw-r--r--src/rabbit_direct.erl2
-rw-r--r--src/rabbit_disk_monitor.erl2
-rw-r--r--src/rabbit_epmd_monitor.erl4
-rw-r--r--src/rabbit_error_logger.erl2
-rw-r--r--src/rabbit_exchange.erl2
-rw-r--r--src/rabbit_exchange_parameters.erl2
-rw-r--r--src/rabbit_exchange_type_direct.erl2
-rw-r--r--src/rabbit_exchange_type_fanout.erl2
-rw-r--r--src/rabbit_exchange_type_headers.erl2
-rw-r--r--src/rabbit_exchange_type_invalid.erl2
-rw-r--r--src/rabbit_exchange_type_topic.erl2
-rw-r--r--src/rabbit_framing.erl2
-rw-r--r--src/rabbit_guid.erl2
-rw-r--r--src/rabbit_lager.erl12
-rw-r--r--src/rabbit_limiter.erl2
-rw-r--r--src/rabbit_log.erl2
-rw-r--r--src/rabbit_memory_monitor.erl2
-rw-r--r--src/rabbit_metrics.erl2
-rw-r--r--src/rabbit_mnesia.erl6
-rw-r--r--src/rabbit_mnesia_rename.erl2
-rw-r--r--src/rabbit_msg_file.erl2
-rw-r--r--src/rabbit_msg_store.erl2
-rw-r--r--src/rabbit_msg_store_ets_index.erl2
-rw-r--r--src/rabbit_msg_store_gc.erl2
-rw-r--r--src/rabbit_node_monitor.erl2
-rw-r--r--src/rabbit_parameter_validation.erl2
-rw-r--r--src/rabbit_password.erl2
-rw-r--r--src/rabbit_password_hashing_md5.erl2
-rw-r--r--src/rabbit_password_hashing_sha256.erl2
-rw-r--r--src/rabbit_password_hashing_sha512.erl2
-rw-r--r--src/rabbit_plugins.erl41
-rw-r--r--src/rabbit_policies.erl2
-rw-r--r--src/rabbit_policy.erl2
-rw-r--r--src/rabbit_prelaunch.erl2
-rw-r--r--src/rabbit_queue_consumers.erl2
-rw-r--r--src/rabbit_queue_index.erl2
-rw-r--r--src/rabbit_queue_location_client_local.erl2
-rw-r--r--src/rabbit_queue_location_min_masters.erl2
-rw-r--r--src/rabbit_queue_location_random.erl2
-rw-r--r--src/rabbit_queue_location_validator.erl2
-rw-r--r--src/rabbit_queue_master_location_misc.erl2
-rw-r--r--src/rabbit_recovery_terms.erl2
-rw-r--r--src/rabbit_resource_monitor_misc.erl2
-rw-r--r--src/rabbit_restartable_sup.erl2
-rw-r--r--src/rabbit_router.erl2
-rw-r--r--src/rabbit_runtime_parameters.erl2
-rw-r--r--src/rabbit_sup.erl2
-rw-r--r--src/rabbit_table.erl2
-rw-r--r--src/rabbit_trace.erl2
-rw-r--r--src/rabbit_upgrade.erl2
-rw-r--r--src/rabbit_upgrade_functions.erl2
-rw-r--r--src/rabbit_variable_queue.erl2
-rw-r--r--src/rabbit_version.erl2
-rw-r--r--src/rabbit_vhost.erl2
-rw-r--r--src/rabbit_vm.erl2
-rw-r--r--src/supervised_lifecycle.erl2
-rw-r--r--src/tcp_listener.erl2
-rw-r--r--src/tcp_listener_sup.erl2
-rw-r--r--src/truncate.erl2
-rw-r--r--src/vm_memory_monitor.erl2
-rw-r--r--src/worker_pool.erl2
-rw-r--r--src/worker_pool_sup.erl2
-rw-r--r--src/worker_pool_worker.erl2
-rw-r--r--test/channel_operation_timeout_test_queue.erl2
-rw-r--r--test/cluster_rename_SUITE.erl2
-rw-r--r--test/clustering_management_SUITE.erl2
-rw-r--r--test/crashing_queues_SUITE.erl2
-rw-r--r--test/credential_validation_SUITE.erl2
-rw-r--r--test/dynamic_ha_SUITE.erl2
-rw-r--r--test/eager_sync_SUITE.erl2
-rw-r--r--test/lazy_queue_SUITE.erl2
-rw-r--r--test/many_node_ha_SUITE.erl2
-rw-r--r--test/rabbit_core_metrics_gc_SUITE.erl2
-rw-r--r--test/rabbit_ha_test_consumer.erl2
-rw-r--r--test/rabbit_ha_test_producer.erl2
-rw-r--r--test/rabbitmqctl_shutdown_SUITE.erl121
-rw-r--r--test/simple_ha_SUITE.erl2
-rw-r--r--test/sync_detection_SUITE.erl2
-rw-r--r--test/worker_pool_SUITE.erl2
114 files changed, 299 insertions, 125 deletions
diff --git a/.gitignore b/.gitignore
index f7a1da4397..d88b753142 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,6 +34,7 @@ docs/rabbitmq-server.1.man.xml
docs/rabbitmq-service.man.xml
docs/rabbitmqctl.1
docs/rabbitmqctl.1.man.xml
+docs/*.tmp
# Dialyzer
*.plt
diff --git a/README.md b/README.md
index 16b56d0b33..e3d7daa43c 100644
--- a/README.md
+++ b/README.md
@@ -46,4 +46,4 @@ RabbitMQ server is [licensed under the MPL](LICENSE-MPL-RabbitMQ).
## Copyright
-(c) Pivotal Software Inc., 2007-2016.
+(c) Pivotal Software Inc., 2007-2017.
diff --git a/docs/rabbitmqctl.1.xml b/docs/rabbitmqctl.1.xml
index ec3bbde75c..b92e1f0229 100644
--- a/docs/rabbitmqctl.1.xml
+++ b/docs/rabbitmqctl.1.xml
@@ -135,6 +135,28 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><cmdsynopsis><command>shutdown</command></cmdsynopsis></term>
+ <listitem>
+ <para>
+ Shuts down the Erlang process on which RabbitMQ is running. The
+ command is blocking and will return after the Erlang process
+ exits. If RabbitMQ fails to stop, it will return a non-zero exit
+ code.
+ </para>
+ <para>
+ Unlike the stop command, the shutdown command:
+ * does not require a pid_file to wait for the Erlang process to exit
+ * if RabbitMQ node is not running, it will return a non-zero exit code
+ </para>
+ <para role="example-prefix">For example:</para>
+ <screen role="example">rabbitmqctl shutdown</screen>
+ <para role="example">
+ This command shuts down the Erlang process on which RabbitMQ is running.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="stop_app">
<term><cmdsynopsis><command>stop_app</command></cmdsynopsis></term>
<listitem>
diff --git a/src/background_gc.erl b/src/background_gc.erl
index 835eaef4df..2ae9d93e4e 100644
--- a/src/background_gc.erl
+++ b/src/background_gc.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(background_gc).
diff --git a/src/dtree.erl b/src/dtree.erl
index a2232c0687..466ec88f33 100644
--- a/src/dtree.erl
+++ b/src/dtree.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
%% A dual-index tree.
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl
index 3f5232a657..070b6e5263 100644
--- a/src/file_handle_cache.erl
+++ b/src/file_handle_cache.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(file_handle_cache).
diff --git a/src/file_handle_cache_stats.erl b/src/file_handle_cache_stats.erl
index f639881a6f..000d1c820c 100644
--- a/src/file_handle_cache_stats.erl
+++ b/src/file_handle_cache_stats.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(file_handle_cache_stats).
diff --git a/src/gatherer.erl b/src/gatherer.erl
index 18302699a2..7cc282442f 100644
--- a/src/gatherer.erl
+++ b/src/gatherer.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(gatherer).
diff --git a/src/gm.erl b/src/gm.erl
index 3a1459fea4..f67050affb 100644
--- a/src/gm.erl
+++ b/src/gm.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(gm).
diff --git a/src/mnesia_sync.erl b/src/mnesia_sync.erl
index 8d5c946635..a263a4f576 100644
--- a/src/mnesia_sync.erl
+++ b/src/mnesia_sync.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(mnesia_sync).
diff --git a/src/rabbit.erl b/src/rabbit.erl
index f510985deb..b1546d4d7e 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit).
@@ -481,7 +481,8 @@ stop_and_halt() ->
try
stop()
catch Type:Reason ->
- rabbit_log:error("Error trying to stop RabbitMQ: ~p:~p", [Type, Reason])
+ rabbit_log:error("Error trying to stop RabbitMQ: ~p:~p", [Type, Reason]),
+ error({Type, Reason})
after
AppsLeft = [ A || {A, _, _} <- application:which_applications() ],
rabbit_log:info(
diff --git a/src/rabbit_access_control.erl b/src/rabbit_access_control.erl
index dedfe96823..e74032eb6d 100644
--- a/src/rabbit_access_control.erl
+++ b/src/rabbit_access_control.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_access_control).
diff --git a/src/rabbit_alarm.erl b/src/rabbit_alarm.erl
index 9466dd0eeb..e08f77d236 100644
--- a/src/rabbit_alarm.erl
+++ b/src/rabbit_alarm.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
%% There are two types of alarms handled by this module:
%%
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index d8b1cbc85b..e9f91041e7 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_amqqueue_process).
diff --git a/src/rabbit_amqqueue_sup.erl b/src/rabbit_amqqueue_sup.erl
index f1e770aa45..ed0595d3e3 100644
--- a/src/rabbit_amqqueue_sup.erl
+++ b/src/rabbit_amqqueue_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_amqqueue_sup).
diff --git a/src/rabbit_amqqueue_sup_sup.erl b/src/rabbit_amqqueue_sup_sup.erl
index c57d9334e2..d0c55b2c0e 100644
--- a/src/rabbit_amqqueue_sup_sup.erl
+++ b/src/rabbit_amqqueue_sup_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_amqqueue_sup_sup).
diff --git a/src/rabbit_auth_mechanism_amqplain.erl b/src/rabbit_auth_mechanism_amqplain.erl
index aad004a628..9016d0d51a 100644
--- a/src/rabbit_auth_mechanism_amqplain.erl
+++ b/src/rabbit_auth_mechanism_amqplain.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_auth_mechanism_amqplain).
diff --git a/src/rabbit_auth_mechanism_cr_demo.erl b/src/rabbit_auth_mechanism_cr_demo.erl
index ed74c3537e..9d4289602c 100644
--- a/src/rabbit_auth_mechanism_cr_demo.erl
+++ b/src/rabbit_auth_mechanism_cr_demo.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_auth_mechanism_cr_demo).
diff --git a/src/rabbit_auth_mechanism_plain.erl b/src/rabbit_auth_mechanism_plain.erl
index 431319622e..7a34b0a112 100644
--- a/src/rabbit_auth_mechanism_plain.erl
+++ b/src/rabbit_auth_mechanism_plain.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_auth_mechanism_plain).
diff --git a/src/rabbit_autoheal.erl b/src/rabbit_autoheal.erl
index 3adcc09692..58f60bb527 100644
--- a/src/rabbit_autoheal.erl
+++ b/src/rabbit_autoheal.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_autoheal).
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl
index e4e8552bc2..e4d9e64d6b 100644
--- a/src/rabbit_binding.erl
+++ b/src/rabbit_binding.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_binding).
diff --git a/src/rabbit_channel_sup.erl b/src/rabbit_channel_sup.erl
index 48cc1e15c2..b091451b52 100644
--- a/src/rabbit_channel_sup.erl
+++ b/src/rabbit_channel_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_channel_sup).
diff --git a/src/rabbit_channel_sup_sup.erl b/src/rabbit_channel_sup_sup.erl
index 885d34d0a7..1ab74f4378 100644
--- a/src/rabbit_channel_sup_sup.erl
+++ b/src/rabbit_channel_sup_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_channel_sup_sup).
diff --git a/src/rabbit_cli.erl b/src/rabbit_cli.erl
index f6d005be90..374f1a9ab9 100644
--- a/src/rabbit_cli.erl
+++ b/src/rabbit_cli.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_cli).
diff --git a/src/rabbit_client_sup.erl b/src/rabbit_client_sup.erl
index 77f0bcb993..3eaa58a043 100644
--- a/src/rabbit_client_sup.erl
+++ b/src/rabbit_client_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_client_sup).
diff --git a/src/rabbit_connection_helper_sup.erl b/src/rabbit_connection_helper_sup.erl
index bde520b74b..8b9d48d4a1 100644
--- a/src/rabbit_connection_helper_sup.erl
+++ b/src/rabbit_connection_helper_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_connection_helper_sup).
diff --git a/src/rabbit_connection_sup.erl b/src/rabbit_connection_sup.erl
index 154bbb1922..85bd96733c 100644
--- a/src/rabbit_connection_sup.erl
+++ b/src/rabbit_connection_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_connection_sup).
diff --git a/src/rabbit_control_pbe.erl b/src/rabbit_control_pbe.erl
index 2fa2c90a6e..ff498ed4aa 100644
--- a/src/rabbit_control_pbe.erl
+++ b/src/rabbit_control_pbe.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_control_pbe).
diff --git a/src/rabbit_credential_validation.erl b/src/rabbit_credential_validation.erl
index 4a629da14f..c502760baa 100644
--- a/src/rabbit_credential_validation.erl
+++ b/src/rabbit_credential_validation.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_credential_validation).
diff --git a/src/rabbit_credential_validator.erl b/src/rabbit_credential_validator.erl
index dd12f6d2d6..53acacd6e6 100644
--- a/src/rabbit_credential_validator.erl
+++ b/src/rabbit_credential_validator.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_credential_validator).
diff --git a/src/rabbit_credential_validator_accept_everything.erl b/src/rabbit_credential_validator_accept_everything.erl
index f572d67e7f..053d54d871 100644
--- a/src/rabbit_credential_validator_accept_everything.erl
+++ b/src/rabbit_credential_validator_accept_everything.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_credential_validator_accept_everything).
diff --git a/src/rabbit_credential_validator_min_password_length.erl b/src/rabbit_credential_validator_min_password_length.erl
index 78239fc71b..aa368a3b94 100644
--- a/src/rabbit_credential_validator_min_password_length.erl
+++ b/src/rabbit_credential_validator_min_password_length.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_credential_validator_min_password_length).
diff --git a/src/rabbit_credential_validator_password_regexp.erl b/src/rabbit_credential_validator_password_regexp.erl
index b516175126..03c7c4cf7b 100644
--- a/src/rabbit_credential_validator_password_regexp.erl
+++ b/src/rabbit_credential_validator_password_regexp.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
diff --git a/src/rabbit_dead_letter.erl b/src/rabbit_dead_letter.erl
index 5b367e410a..ca4871d2e0 100644
--- a/src/rabbit_dead_letter.erl
+++ b/src/rabbit_dead_letter.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_dead_letter).
diff --git a/src/rabbit_diagnostics.erl b/src/rabbit_diagnostics.erl
index e5df1d5baf..19082c0487 100644
--- a/src/rabbit_diagnostics.erl
+++ b/src/rabbit_diagnostics.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_diagnostics).
diff --git a/src/rabbit_direct.erl b/src/rabbit_direct.erl
index 58e6f20cb6..19fc828a52 100644
--- a/src/rabbit_direct.erl
+++ b/src/rabbit_direct.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_direct).
diff --git a/src/rabbit_disk_monitor.erl b/src/rabbit_disk_monitor.erl
index 4c1ff02486..b2548cb61a 100644
--- a/src/rabbit_disk_monitor.erl
+++ b/src/rabbit_disk_monitor.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_disk_monitor).
diff --git a/src/rabbit_epmd_monitor.erl b/src/rabbit_epmd_monitor.erl
index 7f01a71838..9d8044e6ef 100644
--- a/src/rabbit_epmd_monitor.erl
+++ b/src/rabbit_epmd_monitor.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_epmd_monitor).
@@ -92,6 +92,6 @@ check_epmd(#state{mod = Mod,
"epmd does not know us, re-registering ~s at port ~b~n",
[Me, Port]),
rabbit_nodes:ensure_epmd(),
- erl_epmd:register_node(Me, Port);
+ Mod:register_node(Me, Port);
_ -> ok
end.
diff --git a/src/rabbit_error_logger.erl b/src/rabbit_error_logger.erl
index 9640897239..f7b2fb82db 100644
--- a/src/rabbit_error_logger.erl
+++ b/src/rabbit_error_logger.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_error_logger).
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index e52e4734e3..4061098a9d 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_exchange).
diff --git a/src/rabbit_exchange_parameters.erl b/src/rabbit_exchange_parameters.erl
index 8af84a5935..feba5e255b 100644
--- a/src/rabbit_exchange_parameters.erl
+++ b/src/rabbit_exchange_parameters.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_exchange_parameters).
diff --git a/src/rabbit_exchange_type_direct.erl b/src/rabbit_exchange_type_direct.erl
index ed675b572a..9adcd2d297 100644
--- a/src/rabbit_exchange_type_direct.erl
+++ b/src/rabbit_exchange_type_direct.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_exchange_type_direct).
diff --git a/src/rabbit_exchange_type_fanout.erl b/src/rabbit_exchange_type_fanout.erl
index 3aebc07b41..539bd763a1 100644
--- a/src/rabbit_exchange_type_fanout.erl
+++ b/src/rabbit_exchange_type_fanout.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_exchange_type_fanout).
diff --git a/src/rabbit_exchange_type_headers.erl b/src/rabbit_exchange_type_headers.erl
index f7db35be2f..0d5d92c0da 100644
--- a/src/rabbit_exchange_type_headers.erl
+++ b/src/rabbit_exchange_type_headers.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_exchange_type_headers).
diff --git a/src/rabbit_exchange_type_invalid.erl b/src/rabbit_exchange_type_invalid.erl
index 9edb00ee49..e945365aff 100644
--- a/src/rabbit_exchange_type_invalid.erl
+++ b/src/rabbit_exchange_type_invalid.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_exchange_type_invalid).
diff --git a/src/rabbit_exchange_type_topic.erl b/src/rabbit_exchange_type_topic.erl
index 60be070426..5ff5071405 100644
--- a/src/rabbit_exchange_type_topic.erl
+++ b/src/rabbit_exchange_type_topic.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_exchange_type_topic).
diff --git a/src/rabbit_framing.erl b/src/rabbit_framing.erl
index e4a5013003..5ed83aee7e 100644
--- a/src/rabbit_framing.erl
+++ b/src/rabbit_framing.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
%% TODO auto-generate
diff --git a/src/rabbit_guid.erl b/src/rabbit_guid.erl
index 75f9df7b3f..bd2e7e167b 100644
--- a/src/rabbit_guid.erl
+++ b/src/rabbit_guid.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_guid).
diff --git a/src/rabbit_lager.erl b/src/rabbit_lager.erl
index c1ed613088..cb27eda788 100644
--- a/src/rabbit_lager.erl
+++ b/src/rabbit_lager.erl
@@ -182,9 +182,15 @@ configure_lager() ->
end,
case application:get_env(lager, log_root) of
undefined ->
- application:set_env(lager, log_root,
- application:get_env(rabbit, lager_log_root,
- undefined));
+ %% Setting env var to 'undefined' is different from not
+ %% setting it at all, and lager is sensitive to this
+ %% difference.
+ case application:get_env(rabbit, lager_log_root) of
+ {ok, Value} ->
+ application:set_env(lager, log_root, Value);
+ _ ->
+ ok
+ end;
_ -> ok
end,
diff --git a/src/rabbit_limiter.erl b/src/rabbit_limiter.erl
index 74e802b3a0..e81b10a555 100644
--- a/src/rabbit_limiter.erl
+++ b/src/rabbit_limiter.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
%% The purpose of the limiter is to stem the flow of messages from
diff --git a/src/rabbit_log.erl b/src/rabbit_log.erl
index 22181ce8b7..01e171c13c 100644
--- a/src/rabbit_log.erl
+++ b/src/rabbit_log.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_log).
diff --git a/src/rabbit_memory_monitor.erl b/src/rabbit_memory_monitor.erl
index 6fd12b30ff..de0b50ccdc 100644
--- a/src/rabbit_memory_monitor.erl
+++ b/src/rabbit_memory_monitor.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
diff --git a/src/rabbit_metrics.erl b/src/rabbit_metrics.erl
index 1ea28c2906..aa9343cf88 100644
--- a/src/rabbit_metrics.erl
+++ b/src/rabbit_metrics.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_metrics).
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl
index ac125b0fb0..22db6f4b77 100644
--- a/src/rabbit_mnesia.erl
+++ b/src/rabbit_mnesia.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_mnesia).
@@ -863,12 +863,12 @@ with_running_or_clean_mnesia(Fun) ->
case IsMnesiaRunning of
true -> Fun();
false ->
- {ok, MnesiaDir} = application:get_env(mnesia, dir),
+ SavedMnesiaDir = dir(),
application:unset_env(mnesia, dir),
mnesia:start(),
Result = Fun(),
application:stop(mnesia),
- application:set_env(mnesia, dir, MnesiaDir),
+ application:set_env(mnesia, dir, SavedMnesiaDir),
Result
end.
diff --git a/src/rabbit_mnesia_rename.erl b/src/rabbit_mnesia_rename.erl
index bcaaf117ff..43a11bcb4f 100644
--- a/src/rabbit_mnesia_rename.erl
+++ b/src/rabbit_mnesia_rename.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_mnesia_rename).
diff --git a/src/rabbit_msg_file.erl b/src/rabbit_msg_file.erl
index 5c0acc5ffd..eb23d3a7e5 100644
--- a/src/rabbit_msg_file.erl
+++ b/src/rabbit_msg_file.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_msg_file).
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl
index 979de7b6ee..809ec4fda3 100644
--- a/src/rabbit_msg_store.erl
+++ b/src/rabbit_msg_store.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_msg_store).
diff --git a/src/rabbit_msg_store_ets_index.erl b/src/rabbit_msg_store_ets_index.erl
index 1faf3bff14..fa8b504e5f 100644
--- a/src/rabbit_msg_store_ets_index.erl
+++ b/src/rabbit_msg_store_ets_index.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_msg_store_ets_index).
diff --git a/src/rabbit_msg_store_gc.erl b/src/rabbit_msg_store_gc.erl
index 9cfdba8a8d..6179ef95bb 100644
--- a/src/rabbit_msg_store_gc.erl
+++ b/src/rabbit_msg_store_gc.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_msg_store_gc).
diff --git a/src/rabbit_node_monitor.erl b/src/rabbit_node_monitor.erl
index bea2a3fa96..0eadf0ff59 100644
--- a/src/rabbit_node_monitor.erl
+++ b/src/rabbit_node_monitor.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_node_monitor).
diff --git a/src/rabbit_parameter_validation.erl b/src/rabbit_parameter_validation.erl
index 00e83d2757..d93104d02c 100644
--- a/src/rabbit_parameter_validation.erl
+++ b/src/rabbit_parameter_validation.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_parameter_validation).
diff --git a/src/rabbit_password.erl b/src/rabbit_password.erl
index 0538445ab4..9b8ea150af 100644
--- a/src/rabbit_password.erl
+++ b/src/rabbit_password.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_password).
diff --git a/src/rabbit_password_hashing_md5.erl b/src/rabbit_password_hashing_md5.erl
index 75d8e4ee67..ac71bcfbef 100644
--- a/src/rabbit_password_hashing_md5.erl
+++ b/src/rabbit_password_hashing_md5.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
%% Legacy hashing implementation, only used as a last resort when
diff --git a/src/rabbit_password_hashing_sha256.erl b/src/rabbit_password_hashing_sha256.erl
index 5df4d93bda..9381dbf5b0 100644
--- a/src/rabbit_password_hashing_sha256.erl
+++ b/src/rabbit_password_hashing_sha256.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_password_hashing_sha256).
diff --git a/src/rabbit_password_hashing_sha512.erl b/src/rabbit_password_hashing_sha512.erl
index 5a4b9603e9..beb7fa532e 100644
--- a/src/rabbit_password_hashing_sha512.erl
+++ b/src/rabbit_password_hashing_sha512.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_password_hashing_sha512).
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl
index 5165602dd9..14b1c8bcc6 100644
--- a/src/rabbit_plugins.erl
+++ b/src/rabbit_plugins.erl
@@ -71,10 +71,36 @@ ensure(FileJustChanged0) ->
{error, {enabled_plugins_mismatch, FileJustChanged, OurFile}}
end.
+-spec plugins_expand_dir() -> file:filename().
+plugins_expand_dir() ->
+ case application:get_env(rabbit, plugins_expand_dir) of
+ {ok, ExpandDir} ->
+ ExpandDir;
+ _ ->
+ filename:join([rabbit_mnesia:dir(), "plugins_expand_dir"])
+ end.
+
+-spec plugins_dist_dir() -> file:filename().
+plugins_dist_dir() ->
+ case application:get_env(rabbit, plugins_dir) of
+ {ok, PluginsDistDir} ->
+ PluginsDistDir;
+ _ ->
+ filename:join([rabbit_mnesia:dir(), "plugins_dir_stub"])
+ end.
+
+-spec enabled_plugins() -> [atom()].
+enabled_plugins() ->
+ case application:get_env(rabbit, enabled_plugins_file) of
+ {ok, EnabledFile} ->
+ read_enabled(EnabledFile);
+ _ ->
+ []
+ end.
+
%% @doc Prepares the file system and installs all enabled plugins.
setup() ->
- {ok, ExpandDir} = application:get_env(rabbit, plugins_expand_dir),
-
+ ExpandDir = plugins_expand_dir(),
%% Eliminate the contents of the destination directory
case delete_recursively(ExpandDir) of
ok -> ok;
@@ -82,8 +108,7 @@ setup() ->
[ExpandDir, E1]}})
end,
- {ok, EnabledFile} = application:get_env(rabbit, enabled_plugins_file),
- Enabled = read_enabled(EnabledFile),
+ Enabled = enabled_plugins(),
prepare_plugins(Enabled).
extract_schemas(SchemaDir) ->
@@ -132,8 +157,7 @@ extract_schema(#plugin{type = dir, location = Location}, SchemaDir) ->
%% @doc Lists the plugins which are currently running.
active() ->
- {ok, ExpandDir} = application:get_env(rabbit, plugins_expand_dir),
- InstalledPlugins = plugin_names(list(ExpandDir)),
+ InstalledPlugins = plugin_names(list(plugins_expand_dir())),
[App || {App, _, _} <- rabbit_misc:which_applications(),
lists:member(App, InstalledPlugins)].
@@ -244,10 +268,9 @@ running_plugins() ->
%%----------------------------------------------------------------------------
prepare_plugins(Enabled) ->
- {ok, PluginsDistDir} = application:get_env(rabbit, plugins_dir),
- {ok, ExpandDir} = application:get_env(rabbit, plugins_expand_dir),
+ ExpandDir = plugins_expand_dir(),
- AllPlugins = list(PluginsDistDir),
+ AllPlugins = list(plugins_dist_dir()),
Wanted = dependencies(false, Enabled, AllPlugins),
WantedPlugins = lookup_plugins(Wanted, AllPlugins),
{ValidPlugins, Problems} = validate_plugins(WantedPlugins),
diff --git a/src/rabbit_policies.erl b/src/rabbit_policies.erl
index 22eb3fde18..be7d3dcd76 100644
--- a/src/rabbit_policies.erl
+++ b/src/rabbit_policies.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_policies).
diff --git a/src/rabbit_policy.erl b/src/rabbit_policy.erl
index c4fbf1c830..c03c9c5d00 100644
--- a/src/rabbit_policy.erl
+++ b/src/rabbit_policy.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_policy).
diff --git a/src/rabbit_prelaunch.erl b/src/rabbit_prelaunch.erl
index fd17860432..f5905151cc 100644
--- a/src/rabbit_prelaunch.erl
+++ b/src/rabbit_prelaunch.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_prelaunch).
diff --git a/src/rabbit_queue_consumers.erl b/src/rabbit_queue_consumers.erl
index 2bd3ebf75e..4e9715fba2 100644
--- a/src/rabbit_queue_consumers.erl
+++ b/src/rabbit_queue_consumers.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_queue_consumers).
diff --git a/src/rabbit_queue_index.erl b/src/rabbit_queue_index.erl
index 52ec8d9e00..bf80fe53a5 100644
--- a/src/rabbit_queue_index.erl
+++ b/src/rabbit_queue_index.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_queue_index).
diff --git a/src/rabbit_queue_location_client_local.erl b/src/rabbit_queue_location_client_local.erl
index cd7dfddbba..0d4af99a03 100644
--- a/src/rabbit_queue_location_client_local.erl
+++ b/src/rabbit_queue_location_client_local.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_queue_location_client_local).
diff --git a/src/rabbit_queue_location_min_masters.erl b/src/rabbit_queue_location_min_masters.erl
index bc112a30ef..a1e73ee5d5 100644
--- a/src/rabbit_queue_location_min_masters.erl
+++ b/src/rabbit_queue_location_min_masters.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_queue_location_min_masters).
diff --git a/src/rabbit_queue_location_random.erl b/src/rabbit_queue_location_random.erl
index 73d509bf33..5a24a00aa0 100644
--- a/src/rabbit_queue_location_random.erl
+++ b/src/rabbit_queue_location_random.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_queue_location_random).
diff --git a/src/rabbit_queue_location_validator.erl b/src/rabbit_queue_location_validator.erl
index c5aad50e64..2b0f8c7a0f 100644
--- a/src/rabbit_queue_location_validator.erl
+++ b/src/rabbit_queue_location_validator.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_queue_location_validator).
diff --git a/src/rabbit_queue_master_location_misc.erl b/src/rabbit_queue_master_location_misc.erl
index 3d5b2cd472..2cc6d515f4 100644
--- a/src/rabbit_queue_master_location_misc.erl
+++ b/src/rabbit_queue_master_location_misc.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_queue_master_location_misc).
diff --git a/src/rabbit_recovery_terms.erl b/src/rabbit_recovery_terms.erl
index f6f94eca45..c941126cd3 100644
--- a/src/rabbit_recovery_terms.erl
+++ b/src/rabbit_recovery_terms.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
%% We use a gen_server simply so that during the terminate/2 call
diff --git a/src/rabbit_resource_monitor_misc.erl b/src/rabbit_resource_monitor_misc.erl
index 56faefe536..8d743b9a24 100644
--- a/src/rabbit_resource_monitor_misc.erl
+++ b/src/rabbit_resource_monitor_misc.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
diff --git a/src/rabbit_restartable_sup.erl b/src/rabbit_restartable_sup.erl
index 1960259188..14b8fd9a5f 100644
--- a/src/rabbit_restartable_sup.erl
+++ b/src/rabbit_restartable_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_restartable_sup).
diff --git a/src/rabbit_router.erl b/src/rabbit_router.erl
index d4390ac4d8..1f3017fa07 100644
--- a/src/rabbit_router.erl
+++ b/src/rabbit_router.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_router).
diff --git a/src/rabbit_runtime_parameters.erl b/src/rabbit_runtime_parameters.erl
index 64442142da..82dea0bd7c 100644
--- a/src/rabbit_runtime_parameters.erl
+++ b/src/rabbit_runtime_parameters.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_runtime_parameters).
diff --git a/src/rabbit_sup.erl b/src/rabbit_sup.erl
index a457938dc9..38d561fa80 100644
--- a/src/rabbit_sup.erl
+++ b/src/rabbit_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_sup).
diff --git a/src/rabbit_table.erl b/src/rabbit_table.erl
index 56a9c2b578..f77a23bf5e 100644
--- a/src/rabbit_table.erl
+++ b/src/rabbit_table.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_table).
diff --git a/src/rabbit_trace.erl b/src/rabbit_trace.erl
index 4bfd94e1e0..5b8676bac1 100644
--- a/src/rabbit_trace.erl
+++ b/src/rabbit_trace.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_trace).
diff --git a/src/rabbit_upgrade.erl b/src/rabbit_upgrade.erl
index 95af84de39..eae464219a 100644
--- a/src/rabbit_upgrade.erl
+++ b/src/rabbit_upgrade.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_upgrade).
diff --git a/src/rabbit_upgrade_functions.erl b/src/rabbit_upgrade_functions.erl
index 2116e2dfa1..b1d3e90ff8 100644
--- a/src/rabbit_upgrade_functions.erl
+++ b/src/rabbit_upgrade_functions.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_upgrade_functions).
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index c0495bbb4b..300da96441 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_variable_queue).
diff --git a/src/rabbit_version.erl b/src/rabbit_version.erl
index 4e2edd19eb..3d69040b04 100644
--- a/src/rabbit_version.erl
+++ b/src/rabbit_version.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_version).
diff --git a/src/rabbit_vhost.erl b/src/rabbit_vhost.erl
index 7b43017e30..5ed23d9114 100644
--- a/src/rabbit_vhost.erl
+++ b/src/rabbit_vhost.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_vhost).
diff --git a/src/rabbit_vm.erl b/src/rabbit_vm.erl
index 59c63022d8..326e0491d0 100644
--- a/src/rabbit_vm.erl
+++ b/src/rabbit_vm.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_vm).
diff --git a/src/supervised_lifecycle.erl b/src/supervised_lifecycle.erl
index 5b0f56dc26..3e1918d060 100644
--- a/src/supervised_lifecycle.erl
+++ b/src/supervised_lifecycle.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
%% Invoke callbacks on startup and termination.
diff --git a/src/tcp_listener.erl b/src/tcp_listener.erl
index 5f15592455..7c2f4a4934 100644
--- a/src/tcp_listener.erl
+++ b/src/tcp_listener.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(tcp_listener).
diff --git a/src/tcp_listener_sup.erl b/src/tcp_listener_sup.erl
index 5ef652ad60..14654535d6 100644
--- a/src/tcp_listener_sup.erl
+++ b/src/tcp_listener_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(tcp_listener_sup).
diff --git a/src/truncate.erl b/src/truncate.erl
index a1586b0cb0..034bc62fa8 100644
--- a/src/truncate.erl
+++ b/src/truncate.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(truncate).
diff --git a/src/vm_memory_monitor.erl b/src/vm_memory_monitor.erl
index 6b043685bd..7c44cb8e12 100644
--- a/src/vm_memory_monitor.erl
+++ b/src/vm_memory_monitor.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
%% In practice Erlang shouldn't be allowed to grow to more than a half
diff --git a/src/worker_pool.erl b/src/worker_pool.erl
index c0be486f5f..71ed2a359a 100644
--- a/src/worker_pool.erl
+++ b/src/worker_pool.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(worker_pool).
diff --git a/src/worker_pool_sup.erl b/src/worker_pool_sup.erl
index f4ed4d70c2..2608f5c2e6 100644
--- a/src/worker_pool_sup.erl
+++ b/src/worker_pool_sup.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(worker_pool_sup).
diff --git a/src/worker_pool_worker.erl b/src/worker_pool_worker.erl
index c515abe07f..23db127def 100644
--- a/src/worker_pool_worker.erl
+++ b/src/worker_pool_worker.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(worker_pool_worker).
diff --git a/test/channel_operation_timeout_test_queue.erl b/test/channel_operation_timeout_test_queue.erl
index 124fda47b1..10d97726f4 100644
--- a/test/channel_operation_timeout_test_queue.erl
+++ b/test/channel_operation_timeout_test_queue.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(channel_operation_timeout_test_queue).
diff --git a/test/cluster_rename_SUITE.erl b/test/cluster_rename_SUITE.erl
index 9521e04eb5..dd8147e509 100644
--- a/test/cluster_rename_SUITE.erl
+++ b/test/cluster_rename_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(cluster_rename_SUITE).
diff --git a/test/clustering_management_SUITE.erl b/test/clustering_management_SUITE.erl
index 3253695364..2484f8c910 100644
--- a/test/clustering_management_SUITE.erl
+++ b/test/clustering_management_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(clustering_management_SUITE).
diff --git a/test/crashing_queues_SUITE.erl b/test/crashing_queues_SUITE.erl
index 872b771811..457a4110fa 100644
--- a/test/crashing_queues_SUITE.erl
+++ b/test/crashing_queues_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(crashing_queues_SUITE).
diff --git a/test/credential_validation_SUITE.erl b/test/credential_validation_SUITE.erl
index 3ed2e832bd..4f241197fc 100644
--- a/test/credential_validation_SUITE.erl
+++ b/test/credential_validation_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(credential_validation_SUITE).
diff --git a/test/dynamic_ha_SUITE.erl b/test/dynamic_ha_SUITE.erl
index acb46ad872..a33a7752c6 100644
--- a/test/dynamic_ha_SUITE.erl
+++ b/test/dynamic_ha_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(dynamic_ha_SUITE).
diff --git a/test/eager_sync_SUITE.erl b/test/eager_sync_SUITE.erl
index 70d7080269..7f28ea436d 100644
--- a/test/eager_sync_SUITE.erl
+++ b/test/eager_sync_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(eager_sync_SUITE).
diff --git a/test/lazy_queue_SUITE.erl b/test/lazy_queue_SUITE.erl
index fe105cddd0..f6de560832 100644
--- a/test/lazy_queue_SUITE.erl
+++ b/test/lazy_queue_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(lazy_queue_SUITE).
diff --git a/test/many_node_ha_SUITE.erl b/test/many_node_ha_SUITE.erl
index 22b39e7a3d..c5c0382dc7 100644
--- a/test/many_node_ha_SUITE.erl
+++ b/test/many_node_ha_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(many_node_ha_SUITE).
diff --git a/test/rabbit_core_metrics_gc_SUITE.erl b/test/rabbit_core_metrics_gc_SUITE.erl
index 6e7607eea6..0ef86717ac 100644
--- a/test/rabbit_core_metrics_gc_SUITE.erl
+++ b/test/rabbit_core_metrics_gc_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_core_metrics_gc_SUITE).
diff --git a/test/rabbit_ha_test_consumer.erl b/test/rabbit_ha_test_consumer.erl
index f374863f6a..f0ddd9f839 100644
--- a/test/rabbit_ha_test_consumer.erl
+++ b/test/rabbit_ha_test_consumer.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_ha_test_consumer).
diff --git a/test/rabbit_ha_test_producer.erl b/test/rabbit_ha_test_producer.erl
index 66dee3f7a3..fe2d15ed9a 100644
--- a/test/rabbit_ha_test_producer.erl
+++ b/test/rabbit_ha_test_producer.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(rabbit_ha_test_producer).
diff --git a/test/rabbitmqctl_shutdown_SUITE.erl b/test/rabbitmqctl_shutdown_SUITE.erl
new file mode 100644
index 0000000000..f8fd22f746
--- /dev/null
+++ b/test/rabbitmqctl_shutdown_SUITE.erl
@@ -0,0 +1,121 @@
+%% The contents of this file are subject to the Mozilla Public License
+%% Version 1.1 (the "License"); you may not use this file except in
+%% compliance with the License. You may obtain a copy of the License
+%% at http://www.mozilla.org/MPL/
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and
+%% limitations under the License.
+%%
+%% The Original Code is RabbitMQ.
+%%
+%% The Initial Developer of the Original Code is GoPivotal, Inc.
+%% Copyright (c) 2017 Pivotal Software, Inc. All rights reserved.
+%%
+-module(rabbitmqctl_shutdown_SUITE).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("amqp_client/include/amqp_client.hrl").
+
+-compile(export_all).
+
+all() ->
+ [
+ {group, running_node},
+ {group, non_running_node}
+ ].
+
+groups() ->
+ [
+ {running_node, [], [
+ successful_shutdown,
+ error_during_shutdown
+ ]},
+ {non_running_node, [], [
+ nothing_to_shutdown
+ ]}
+ ].
+
+init_per_suite(Config) ->
+ rabbit_ct_helpers:log_environment(),
+ rabbit_ct_helpers:run_setup_steps(Config).
+
+end_per_suite(Config) ->
+ rabbit_ct_helpers:run_teardown_steps(Config).
+
+init_per_group(running_node, Config) ->
+ rabbit_ct_helpers:set_config(Config, [
+ {rmq_nodename_suffix, ?MODULE},
+ {need_start, true}
+ ]);
+init_per_group(non_running_node, Config) ->
+ rabbit_ct_helpers:set_config(Config, [
+ {rmq_nodename_suffix, ?MODULE}
+ ]).
+
+end_per_group(running_node, Config) ->
+ rabbit_ct_helpers:run_teardown_steps(Config, []);
+end_per_group(non_running_node, Config) ->
+ rabbit_ct_helpers:run_teardown_steps(Config, []).
+
+init_per_testcase(Testcase, Config0) ->
+ Config1 = case ?config(need_start, Config0) of
+ true ->
+ rabbit_ct_helpers:run_setup_steps(Config0,
+ rabbit_ct_broker_helpers:setup_steps() ++
+ [fun save_node/1]);
+ _ ->
+ rabbit_ct_helpers:set_config(Config0,
+ [{node, non_existent_node@localhost}])
+ end,
+ rabbit_ct_helpers:testcase_started(Config1, Testcase).
+
+end_per_testcase(Testcase, Config0) ->
+ Config1 = case ?config(need_start, Config0) of
+ true ->
+ rabbit_ct_helpers:run_teardown_steps(Config0,
+ rabbit_ct_broker_helpers:teardown_steps());
+ _ -> Config0
+ end,
+ rabbit_ct_helpers:testcase_finished(Config1, Testcase).
+
+save_node(Config) ->
+ Node = rabbit_ct_broker_helpers:get_node_config(Config, 0, nodename),
+ rabbit_ct_helpers:set_config(Config, [{node, Node}]).
+
+successful_shutdown(Config) ->
+ Node = ?config(node, Config),
+ Pid = node_pid(Node),
+ ok = rabbit_control_main:action(shutdown, Node, [], [], fun ct:pal/2),
+ false = erlang_pid_is_running(Pid),
+ false = node_is_running(Node).
+
+error_during_shutdown(Config) ->
+ Node = ?config(node, Config),
+ ok = rabbit_control_main:action(stop_app, Node, [], [], fun ct:pal/2),
+ ok = rpc:call(Node, application, unload, [os_mon]),
+
+ {badrpc,
+ {'EXIT', {
+ {error, {badmatch, {error,{edge,{bad_vertex,os_mon},os_mon,rabbit}}}},
+ _}}} =
+ rabbit_control_main:action(shutdown, Node, [], [], fun ct:pal/2).
+
+
+nothing_to_shutdown(Config) ->
+ Node = ?config(node, Config),
+
+ { badrpc, nodedown } =
+ rabbit_control_main:action(shutdown, Node, [], [], fun ct:pal/2).
+
+node_pid(Node) ->
+ Val = rpc:call(Node, os, getpid, []),
+ true = is_list(Val),
+ list_to_integer(Val).
+
+erlang_pid_is_running(Pid) ->
+ rabbit_misc:is_os_process_alive(integer_to_list(Pid)).
+
+node_is_running(Node) ->
+ net_adm:ping(Node) == pong.
diff --git a/test/simple_ha_SUITE.erl b/test/simple_ha_SUITE.erl
index af85ad6d3b..b655c1c8cf 100644
--- a/test/simple_ha_SUITE.erl
+++ b/test/simple_ha_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(simple_ha_SUITE).
diff --git a/test/sync_detection_SUITE.erl b/test/sync_detection_SUITE.erl
index 3e5ed8208b..f62cb846da 100644
--- a/test/sync_detection_SUITE.erl
+++ b/test/sync_detection_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(sync_detection_SUITE).
diff --git a/test/worker_pool_SUITE.erl b/test/worker_pool_SUITE.erl
index 9b6b0721a2..d15f42c504 100644
--- a/test/worker_pool_SUITE.erl
+++ b/test/worker_pool_SUITE.erl
@@ -11,7 +11,7 @@
%% The Original Code is RabbitMQ.
%%
%% The Initial Developer of the Original Code is GoPivotal, Inc.
-%% Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
+%% Copyright (c) 2007-2017 Pivotal Software, Inc. All rights reserved.
%%
-module(worker_pool_SUITE).