%%% Copyright (c) 2019, Sunet. %%% See LICENSE for licensing information. -module(p11p_sup). -behaviour(supervisor). %% API. -export([start_link/0]). %% Supervisor callbacks. -export([init/1]). %% From supervisor. -type start_link_err() :: {already_started, pid()} | shutdown | term(). -type start_link_ret() :: {ok, pid()} | ignore | {error, start_link_err()}. -spec start_link() -> start_link_ret(). start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []). %% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} -define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}). init([]) -> {ok, {{rest_for_one, 1, 5}, [ ?CHILD(p11p_config, worker), ?CHILD(p11p_manager, worker), ?CHILD(p11p_server_sup, supervisor) ]}}.