<div dir="ltr">Hi,<br><br>I&#39;m trying to modify mod_rest.<br>I don&#39;t understand why mod_rest needs to define the supervisor:<br><br>start(_Host, _Opts) -&gt;<br>    ?DEBUG(&quot;Starting: ~p ~p&quot;, [_Host, _Opts]),<br>
    RESTSupervisor = {<br>      ejabberd_mod_rest_sup, {<br>    ejabberd_tmp_sup, start_link,<br>    [ejabberd_mod_rest_sup, ejabberd_mod_rest]<br>       },<br>      permanent,<br>      infinity,<br>      supervisor,<br>      [ejabberd_tmp_sup]<br>
     },<br>    case supervisor:start_child(ejabberd_sup, RESTSupervisor) of<br>    {ok, _Pid} -&gt; ok;<br>    {ok, _Pid, _Info} -&gt; ok;<br>    {error, Error } -&gt; {&#39;EXIT&#39;, {start_child_error, Error}}<br>    end.<br>
<br>while mod_xmlrpc don&#39;t:<br><br>start_listener({Port, Ip}, Opts) -&gt;<br>    %% get options<br>    MaxSessions = gen_mod:get_opt(maxsessions, Opts, 10),<br>    Timeout = gen_mod:get_opt(timeout, Opts, 5000),<br>    AccessCommands = gen_mod:get_opt(access_commands, Opts, all),<br>
<br>    %% start the XML-RPC server<br>    Handler = {?MODULE, handler},<br>    State = #state{access_commands = AccessCommands},<br>    xmlrpc:start_link(Ip, Port, MaxSessions, Timeout, Handler, State).<br><br>In addition, ejabberd wiki about http request handlers doesn&#39;t mention supervisors <a href="http://www.process-one.net/en/wiki/ejabberd_HTTP_request_handlers/">http://www.process-one.net/en/wiki/ejabberd_HTTP_request_handlers/</a><br>
Is mod_rest a specific case that requires to define the supervisor?<br><br>Thanks<br></div>