[erlang-questions] inets service startup

Serge Aleynikov serge@REDACTED
Wed Apr 11 23:04:40 CEST 2007

Ingela Anderton Andin wrote:
>> While this solution works, this way of error handling doesn't seem 
>> appealing to me.  It looks that it would be nicer if INETS would offer 
>> some sort of customization of action of what to do on httpd service 
>> startup problems.
> Thank you for your input.
> That would be possible. We will take this under consideration when 
> constructing the new API.

This would be helpful indeed.

>> Below is the code describing this workaround.  One other issue with 
>> this approach is that if there are other httpd services started by 
>> inets though its own environment options, if we want to stop the httpd 
>> instance managed by our custom app, there doesn't seem to be an easy 
>> way of figuring out which httpd service to stop.  Perhaps returning 
>> httpd service's name {httpd_instance_sup, Addr, Port} by the 
>> httpd_sup:start_child/1 function would help.
> There is no easy way, that is one of the points that will be improved in 
> a future release of intes.

I was poking around through inets code, and there turns out to be an 
option in httpd.erl for starting httpd service by hooking it up to a 
custom supervisor (httpd:start_link/1).  This seems to solve the second 
problem I had of being able to separate a critical httpd service from 
the other ones managed by inets.

Serge Aleynikov
Routing R&D, IDT Telecom
Tel: +1 (973) 438-3436
Fax: +1 (973) 438-1464

More information about the erlang-questions mailing list