summaryrefslogtreecommitdiff
path: root/ereproxy.erl
blob: 487aeda9d0271ee3b073ca24a46e5d632bda7cb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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]]}}.
contact: Jan Huwald // Impressum