diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rabbit.erl | 14 | ||||
-rw-r--r-- | src/rabbit_plugins.erl | 7 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index b4943a30..6c08520f 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -311,8 +311,7 @@ start() -> ok = ensure_working_log_handlers(), rabbit_node_monitor:prepare_cluster_status_files(), rabbit_mnesia:check_cluster_consistency(), - start_apps(app_startup_order()), - ok = log_broker_started(rabbit_plugins:active()) + broker_start() end). boot() -> @@ -327,12 +326,15 @@ boot() -> %% the upgrade, since if we are a secondary node the %% primary node will have forgotten us rabbit_mnesia:check_cluster_consistency(), - Plugins = rabbit_plugins:setup(), - ToBeLoaded = Plugins ++ ?APPS, - start_apps(ToBeLoaded), - ok = log_broker_started(Plugins) + broker_start() end). +broker_start() -> + Plugins = rabbit_plugins:setup(), + ToBeLoaded = Plugins ++ ?APPS, + start_apps(ToBeLoaded), + ok = log_broker_started(rabbit_plugins:active()). + handle_app_error(Term) -> fun(App, {bad_return, {_MFA, {'EXIT', {ExitReason, _}}}}) -> throw({Term, App, ExitReason}); diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index edb7b12f..cc65c569 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -44,8 +44,11 @@ enable(Plugins) -> ok = rabbit_event:notify(plugins_changed, [{enabled, Diff}]). disable(Plugins) -> - Diff = rabbit:stop_apps(Plugins), - ok = rabbit_event:notify(plugins_changed, [{disabled, Plugins}]). + RunningApps = rabbit_misc:which_applications(), + ToDisable = [P || P <- Plugins, + proplists:is_defined(P, RunningApps)], + rabbit:stop_apps(ToDisable), + ok = rabbit_event:notify(plugins_changed, [{disabled, ToDisable}]). %% @doc Prepares the file system and installs all enabled plugins. setup() -> |