diff options
Diffstat (limited to 'ereproxy.erl')
-rw-r--r-- | ereproxy.erl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ereproxy.erl b/ereproxy.erl new file mode 100644 index 0000000..487aeda --- /dev/null +++ b/ereproxy.erl @@ -0,0 +1,28 @@ +-module(ereproxy). +-behaviour(application). +-behaviour(supervisor). +-export([start/0, start/2, stop/1, init/1]). + +start() -> + application:start(?MODULE, permanent). + +%%% application callbacks + +start(_Type, CfgMod) -> + lists:map(fun(N) -> ok = application:start(N) end, + [crypto, public_key, ssl]), + supervisor:start_link(?MODULE, CfgMod). + +stop(_State) -> + ok. + +%%% supervisor callbacks + +init(CfgMod) -> + % return child spec + {ok, {{one_for_one, 10, 3600}, + [{Mod, + {Mod, start_link, [CfgMod]}, + permanent, brutal_kill, worker, + [Mod]} + || Mod <- [ereproxy_server, ereproxy_log]]}}. |