[erlang-questions] using inet_gethost_native even if disabled

Raimo Niskanen <>
Mon Apr 8 16:54:36 CEST 2013


On Wed, Apr 03, 2013 at 02:50:29PM +0200, Benoit Chesneau wrote:
> So I tried to use the environment variable and it is still using the
> native resolving:
> 
> Here is the trace:
> 
> I/ErlangThread( 1447): default inetrc path:
> /data/data/com.example.app/erlang/bin/erl_inetrc
> V/ErlangThread( 1447):
> {error_logger,{{2013,4,3},{14,45,27}},"~s~n",["Error in process
> <0.17.0> with exit value:
> {epipe,[{erts_internal,port_command,[#Port<0.54>,[<<6
> bytes>>,\"localhost\",0],[]],[]},{erlang,port_command,2,[]},{inet_gethost_native,run_once,0,[{file,\"inet_gethost_native.erl\"},{line,152}]}]}\n"]}
> 

Have you got more information on when this happens and on what OS.
It appears to be Android, and both the Pid <0.17.0> and the
inet_gethost_native:run_once() call indicates that this is
early in the start of the node. Can you confirm.

If so it might be that early in the start inet_gethost_native
is called before [file,dns] has been enforced and thus can
be regarded a bug.

Is the node started with short or long hostnames? More information
about exactly how the node is started is needed.

It might also be that this is a problem that the Android porter
has run into.



> The first line display what is passed to setenv.
> 
> And when I read the erl_inetrc content on the device I have:
> 
> # cat /data/data/com.daleharvey.mobilefuton/erlang/bin/erl_inetrc
> %% Use erlang's internal resolver. Native DNS on android is annoying
> {lookup, [file,dns]}.
> 
> 
> not sure what's the problem there...
> 
> - benoît
> 
> 
> On Wed, Apr 3, 2013 at 2:47 PM, Benoit Chesneau <> wrote:
> > On Wed, Apr 3, 2013 at 11:57 AM, Danil Zagoskin <> wrote:
> >> Hello.
> >>
> >> Try to start your VM with custom inetrc. Just set ERL_INETRC environment
> >> variable to inet config file path.
> >> In config file write:
> >>    {lookup, [file, dns]}.
> >>
> >> This will tell erlang's resolver to use it's own DNS client, not system one.
> >> More info at http://www.erlang.org/doc/apps/erts/inet_cfg.html
> >>
> >
> > mmm thanks, I will try to set the env I was using the option `-kernel
> > inetrc /path/to/erl_inetrc` for now but it doesn't seem to work .
> >
> > - benoît
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list