[erlang-questions] inets service startup

Ingela Anderton Andin ingela@REDACTED
Wed Apr 11 09:45:09 CEST 2007

Hi Serge!

I do not know why that line was ever entered, and it was a bad idea not 
to remove it altogether.
The httpd_sup supervisor is a one_for_one supervisor which means that if 
there is a problem
with one child it should not affect the other children.  It is possible 
to start several HTTP-servers
and a configuration error in one of them should not have a bearing on 
the others. Maybe the
error could be reported differently to be more "user friendly".

Regards Ingela -OTP Team
>>> While accidentally entering wrong information in inets' server 
>>> configuration file I got an error report stating that a child spec was 
>>> not created.  As a result the corresponding service didn't get started.
>>> Upon examining sources, I found the following code with 
>>> exit({error,Reason}) commented out:
>>> httpd_sup.erl:
>>> ==============
>>> child_spec([], Acc) ->
>>>      Acc;
>>> child_spec([{httpd, HttpdService} | Rest], Acc) ->
>>>      NewHttpdService = mk_tuple_list(HttpdService),
>>>      %%    Acc2 = child_spec2(NewHttpdService,Acc),
>>>      NewAcc=
>>>      case catch child_spec2(NewHttpdService) of
>>>          {ok,Acc2} ->
>>>          [Acc2|Acc];
>>>          {error,Reason} ->
>>>          error_msg("failed to create child spec for ~n~p~ndue to: ~p",
>>>                [HttpdService,Reason]),
>>> %       exit({error,Reason})
>>>          Acc
>>>      end,
>>>      child_spec(Rest,NewAcc).
>>> I was wondering what the authors had in mind by somewhat silently 
>>> ignoring the critical error at startup.  Wouldn't it be proper to 
>>> uncomment that line?
>>> Serge

More information about the erlang-questions mailing list