mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +02:00
Use OTP application startup infrastructure for starting dependencies
This commit is contained in:
parent
325877446a
commit
d47bc1efdb
3 changed files with 3 additions and 16 deletions
|
@ -5,7 +5,7 @@
|
||||||
{vsn, "@PACKAGE_VERSION@"},
|
{vsn, "@PACKAGE_VERSION@"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib]},
|
{applications, [kernel, stdlib, crypto, sasl, ssl, p1_utils, fast_yaml, fast_tls, pkix, xmpp, cache_tab, eimp]},
|
||||||
{env, [{enabled_backends, [@enabled_backends@]}]},
|
{env, [{enabled_backends, [@enabled_backends@]}]},
|
||||||
{mod, {ejabberd_app, []}}]}.
|
{mod, {ejabberd_app, []}}]}.
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,8 @@
|
||||||
|
|
||||||
start() ->
|
start() ->
|
||||||
%%ejabberd_cover:start(),
|
%%ejabberd_cover:start(),
|
||||||
application:start(ejabberd).
|
ejabberd_logger:start(),
|
||||||
|
application:ensure_all_started(ejabberd).
|
||||||
|
|
||||||
stop() ->
|
stop() ->
|
||||||
application:stop(ejabberd).
|
application:stop(ejabberd).
|
||||||
|
|
|
@ -39,9 +39,7 @@
|
||||||
|
|
||||||
start(normal, _Args) ->
|
start(normal, _Args) ->
|
||||||
{T1, _} = statistics(wall_clock),
|
{T1, _} = statistics(wall_clock),
|
||||||
ejabberd_logger:start(),
|
|
||||||
write_pid_file(),
|
write_pid_file(),
|
||||||
start_apps(),
|
|
||||||
start_elixir_application(),
|
start_elixir_application(),
|
||||||
ejabberd:check_app(ejabberd),
|
ejabberd:check_app(ejabberd),
|
||||||
setup_if_elixir_conf_used(),
|
setup_if_elixir_conf_used(),
|
||||||
|
@ -148,18 +146,6 @@ file_queue_init() ->
|
||||||
end,
|
end,
|
||||||
p1_queue:start(QueueDir).
|
p1_queue:start(QueueDir).
|
||||||
|
|
||||||
start_apps() ->
|
|
||||||
crypto:start(),
|
|
||||||
ejabberd:start_app(sasl),
|
|
||||||
ejabberd:start_app(ssl),
|
|
||||||
ejabberd:start_app(p1_utils),
|
|
||||||
ejabberd:start_app(fast_yaml),
|
|
||||||
ejabberd:start_app(fast_tls),
|
|
||||||
ejabberd:start_app(pkix),
|
|
||||||
ejabberd:start_app(xmpp),
|
|
||||||
ejabberd:start_app(cache_tab),
|
|
||||||
ejabberd:start_app(eimp).
|
|
||||||
|
|
||||||
setup_if_elixir_conf_used() ->
|
setup_if_elixir_conf_used() ->
|
||||||
case ejabberd_config:is_using_elixir_config() of
|
case ejabberd_config:is_using_elixir_config() of
|
||||||
true -> 'Elixir.Ejabberd.Config.Store':start_link();
|
true -> 'Elixir.Ejabberd.Config.Store':start_link();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue