node startup crash

Serge Aleynikov <>
Tue Apr 26 22:21:07 CEST 2005


Per Hedeland wrote:
>>In case of this server netstat ("netstat -a | grep 4369") wasn't seeing 
>>anything listening on 127.0.0.1:4369,
> 
> 
> That's not to be expected - what you should see is a LISTEN on
> 0.0.0.0:4369.

Yes, but this wasn't happening.

>>epmd starts by binding to port 4369 using INADDR_ANY (telling the kernel 
>>to choose the IP address for it).  So, since the loopback address 
>>"127.0.0.1" was taken by some other process, it bound to some other IP 
>>address ("172.16.202.77" in case of this host) defined by the eth0 
>>interface.
> 
> 
> Actually no, that would be broken behaviour - binding to the wildcard
> INADDR_ANY should fail with EADDRINUSE in that case. And EADDRNOTAVAIL
> does not mean that the address is used by some other process, but that
> the address simply doesn't exist locally. Presumably no connections to
> 127.0.0.1 could be made on your box, regardless of port.

You mean that the address is said to be badly specified in case when you 
are getting EADDRINUSE despite the fact that SO_REUSEADDR is specified? 
  I also expected the epmd to fail with EADDRINUSE, but this wasn't 
happening.

> Just curious, did you check that the loopback interface actually had
> 127.0.0.1 configured before doing that? 

Surely.  /sbin/ifconfig showed it listed.

> If it did, you probably had some
> mess-up in your routing tables - Linux (probably other OSes too)
> determines whether an address is local through a routing lookup:
> 
> $ ip route ls table local | grep 127.0.0.1
> ...
> local 127.0.0.1 dev lo  proto kernel  scope host  src 127.0.0.1 
> 
> The route gets put there "automagically" by the kernel when the address
> is configured on the interface, but it's possible to delete it...

This I didn't try, but will keep that in mind if I happen to encounter 
the same issue.

Regards,

Serge



More information about the erlang-questions mailing list