mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Stop ejabberd_system_monitor before stopping node
Sometimes monitor module is performing checks when node is stopping and this causes crash in monitoring process.
This commit is contained in:
parent
54cf37e917
commit
d91812730b
@ -103,6 +103,7 @@ prep_stop(State) ->
|
||||
ejabberd_sm:stop(),
|
||||
ejabberd_service:stop(),
|
||||
ejabberd_s2s:stop(),
|
||||
ejabberd_system_monitor:stop(),
|
||||
gen_mod:stop(),
|
||||
State.
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
-author('ekhramtsov@process-one.net').
|
||||
|
||||
%% API
|
||||
-export([start/0, config_reloaded/0]).
|
||||
-export([start/0, config_reloaded/0, stop/0]).
|
||||
|
||||
%% gen_event callbacks
|
||||
-export([init/1, handle_event/2, handle_call/2,
|
||||
@ -68,6 +68,10 @@ start() ->
|
||||
ejabberd:start_app(os_mon),
|
||||
set_oom_watermark().
|
||||
|
||||
-spec stop() -> term().
|
||||
stop() ->
|
||||
gen_event:delete_handler(alarm_handler, ?MODULE, []).
|
||||
|
||||
excluded_apps() ->
|
||||
[os_mon, mnesia, sasl, stdlib, kernel].
|
||||
|
||||
@ -115,7 +119,8 @@ handle_info(Info, State) ->
|
||||
?WARNING_MSG("unexpected info: ~p~n", [Info]),
|
||||
{ok, State}.
|
||||
|
||||
terminate(_Reason, _State) ->
|
||||
terminate(_Reason, State) ->
|
||||
misc:cancel_timer(State#state.tref),
|
||||
ejabberd_hooks:delete(config_reloaded, ?MODULE, config_reloaded, 50).
|
||||
|
||||
code_change(_OldVsn, State, _Extra) ->
|
||||
|
Loading…
Reference in New Issue
Block a user