diff --git a/src/machi.app.src b/src/machi.app.src index c26154f..a9f96f0 100644 --- a/src/machi.app.src +++ b/src/machi.app.src @@ -1,7 +1,7 @@ {application, machi, [ {description, "A village of write-once files."}, - {vsn, "0.0.0"}, - {applications, [kernel, stdlib, crypto, cluster_info]}, + {vsn, "0.0.1"}, + {applications, [kernel, stdlib, crypto, cluster_info, ranch]}, {mod,{machi_app,[]}}, {registered, []}, {env, [ diff --git a/src/machi_sup.erl b/src/machi_sup.erl index 6cf7695..f7ddd10 100644 --- a/src/machi_sup.erl +++ b/src/machi_sup.erl @@ -65,5 +65,11 @@ init([]) -> LifecycleMgr = {machi_lifecycle_mgr, {machi_lifecycle_mgr, start_link, []}, Restart, Shutdown, worker, []}, - - {ok, {SupFlags, [ServerSup, RanchSup, LifecycleMgr]}}. + RunningApps = [A || {A,_D,_V} <- application:which_applications()], + Specs = case lists:member(ranch, RunningApps) of + true -> + [ServerSup, LifecycleMgr]; + false -> + [ServerSup, RanchSup, LifecycleMgr] + end, + {ok, {SupFlags, Specs}}.