Halt ejabberd if the top supervisor fails to start

This commit is contained in:
Evgeniy Khramtsov 2017-11-14 18:41:28 +03:00
parent f953621ed2
commit 054413d8f4
1 changed files with 3 additions and 1 deletions

View File

@ -60,7 +60,9 @@ start(normal, _Args) ->
lists:foreach(fun erlang:garbage_collect/1, processes()),
{ok, SupPid};
Err ->
Err
?CRITICAL_MSG("Failed to start ejabberd application: ~p", [Err]),
timer:sleep(1000),
halt("Refer to ejabberd log files to diagnose the problem")
end;
start(_, _) ->
{error, badarg}.