[erlang-bugs] epmd assumes 127.0.0.1 is always available

Thomas Steen Rasmussen thomas@REDACTED
Sat Oct 13 22:31:03 CEST 2012


Hello guys,

I am using erlang in a FreeBSD jail for RabbitMQ and I've hit what I
belive is a wrong assumption in epmd. FreeBSD jails do not have
127.0.0.1 available. Instead you normally add the jails IP as
localhost in /etc/hosts to help software that connects to localhost
find the correct IP to use.

However in the case of erlang, in line 198 of erl_epmd.erl:
https://github.com/erlang/otp/blob/maint/lib/kernel/src/erl_epmd.erl#L198
The localhost IP is assumed to be 127.0.0.1. I believe this should be
a DNS lookup of the name "localhost" to accomodate systems without a
127.0.0.1 IP.

When I patched line 198 in erl_epmd.erl to use the jails IP instead of
127.0.0.1, and added the jails IP as "localhost" in /etc/hosts, it
worked like a charm. Before the change, I got the following error when
trying to start rabbitmq: http://pastebin.com/Aw4Bd7wm

I am by no means an erlang expert, in fact today may be the first
time I've really looked at erlang code, so making the change myself
might be a bit much for me. But what do you think ? Do you agree that
this can be considered a bug ?


Best regards,

Thomas Steen Rasmussen

ps. Someone just reminded me that this wouldn't work in an ipv6 only
environment either, just one more reason to make the change :)




More information about the erlang-bugs mailing list