summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-11-07 12:16:13 +0000
committerSimon MacMullen <simon@rabbitmq.com>2011-11-07 12:16:13 +0000
commitb43248811c2b1e380218bfff5e6713ce6ec6d083 (patch)
tree6a497cdcedfcf915d1f898203d0e308785aa67e7
parent1d31bd97926db8fcce132906c17cf4105467df9a (diff)
downloadrabbitmq-server-bug24534.tar.gz
Big ugly warning.bug24534
-rw-r--r--src/rabbit_plugins.erl25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl
index b06bcd83..0862f1b2 100644
--- a/src/rabbit_plugins.erl
+++ b/src/rabbit_plugins.erl
@@ -105,11 +105,11 @@ action(enable, ToEnable0, _Opts, PluginsFile, PluginsDir) ->
end,
NewEnabled = lists:usort(Enabled ++ ToEnable),
write_enabled_plugins(PluginsFile, NewEnabled),
+ NewImplicitlyEnabled = calculate_required_plugins(NewEnabled, AllPlugins),
+ maybe_warn_mochiweb(NewImplicitlyEnabled),
case NewEnabled -- ImplicitlyEnabled of
[] -> io:format("Plugin configuration unchanged.~n");
- _ -> NewImplicitlyEnabled =
- calculate_required_plugins(NewEnabled, AllPlugins),
- print_list("The following plugins have been enabled:",
+ _ -> print_list("The following plugins have been enabled:",
NewImplicitlyEnabled -- ImplicitlyEnabled),
io:format("Plugin configuration has changed. "
"Restart RabbitMQ for changes to take effect.~n")
@@ -355,3 +355,22 @@ calculate_dependencies(Reverse, Sources, AllPlugins) ->
end,
true = digraph:delete(G),
Dests.
+
+maybe_warn_mochiweb(Enabled) ->
+ V = erlang:system_info(otp_release),
+ case lists:member(mochiweb, Enabled) andalso V < "R13B01" of
+ true ->
+ Stars = string:copies("*", 80),
+ io:format("~n~n~s~n"
+ " Warning: Mochiweb enabled and Erlang version ~s "
+ "detected.~n"
+ " Enabling plugins that depend on Mochiweb is not "
+ "supported on this Erlang~n"
+ " version. At least R13B01 is required.~n~n"
+ " RabbitMQ will not start successfully in this "
+ "configuration. You *must*~n"
+ " disable the Mochiweb plugin, or upgrade Erlang.~n"
+ "~s~n~n~n", [Stars, V, Stars]);
+ false ->
+ ok
+ end.