-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, []). -define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}). %% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} init([]) -> {ok, {{rest_for_one, 1, 5}, [ ?CHILD(p11p_config, worker), ?CHILD(p11p_server_sup, supervisor) ]}}.