[erlang-questions] use inetrc to add entries to perceived /etc/hosts

Michael Santos <>
Tue Oct 4 18:36:08 CEST 2011


On Tue, Oct 04, 2011 at 04:31:19PM +0200, Philip Müller wrote:
> On Tue, 04 Oct 2011 15:28:23 +0200, Michael Santos
> <> wrote:
> 
> >On Tue, Oct 04, 2011 at 02:14:45PM +0200, Philip Müller wrote:
> >>Hi everybody,
> >>
> >>we are working on a distributed erlang project. We want to have as
> >>little dependencies on specific infrastructure as possible.
> [...]
> >>Running slave:start(host1). on host2 always gave the following error:
> >>>{error,timeout}
> >>But a simple "ssh 192.168.2.100" works.
> >>
> >>Any ideas what we did wrong?
> >
> >Try enforcing the lookup order. Add this to the "erl_inetrc" file:
> >
> >{lookup, [file, dns]}.
> >
> 
> Thanks for the tip but alas, it does not work. Still getting a timeout.
> Are there ways to diagnose this further? We do not know whether the
> hostname-ip mappings are imported at all.

The timeout is using slave:start/1? Use slave:start/3 to pass cli
options to the slave:

fcs:~$ cat erl_inetrc
{lookup, [file, dns]}.

fcs:~$ erl -rsh ssh -sname test -kernel inetrc '"./erl_inetrc"'
()3> slave:start('fcs', 't', "-kernel inetrc '\"./erl_inetrc\"'").
{}

()4> rpc:call('', inet_db, get_rc, []).
[{resolv_conf,"/etc/resolv.conf"},
 {hosts_file,"/etc/hosts"},
 {lookup,[file,dns]}]



More information about the erlang-questions mailing list