]> granicus.if.org Git - ejabberd/commitdiff
Use OTP application startup infrastructure for starting dependencies
authorPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 9 Jan 2019 17:14:50 +0000 (18:14 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Wed, 9 Jan 2019 17:14:50 +0000 (18:14 +0100)
src/ejabberd.app.src.in
src/ejabberd.erl
src/ejabberd_app.erl

index 407fc68e1d1c51c15b1591776311f4668d32864b..ea3a7894d80154c500fd5c1ac1ef23c4fdac7764 100644 (file)
@@ -5,7 +5,7 @@
   {vsn, "@PACKAGE_VERSION@"},
   {modules, []},
   {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@]}]},
   {mod, {ejabberd_app, []}}]}.
 
index 9992d73929e9d61269c5a3eb550a66f7ec07e7bf..a8ea2ddc22507efcfe97ba6a88c0b814ba3a2904 100644 (file)
@@ -44,7 +44,8 @@
 
 start() ->
     %%ejabberd_cover:start(),
-    application:start(ejabberd).
+    ejabberd_logger:start(),
+    application:ensure_all_started(ejabberd).
 
 stop() ->
     application:stop(ejabberd).
index 20e9a7df799434090617744a01805f347565d8b9..4f33618a4cb16f80091f005a51c197e0700bfd97 100644 (file)
@@ -39,9 +39,7 @@
 
 start(normal, _Args) ->
     {T1, _} = statistics(wall_clock),
-    ejabberd_logger:start(),
     write_pid_file(),
-    start_apps(),
     start_elixir_application(),
     ejabberd:check_app(ejabberd),
     setup_if_elixir_conf_used(),
@@ -148,18 +146,6 @@ file_queue_init() ->
               end,
     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() ->
   case ejabberd_config:is_using_elixir_config() of
     true -> 'Elixir.Ejabberd.Config.Store':start_link();