98: Address already in use

Maxim Dounin mdounin at mdounin.ru
Fri Apr 15 20:17:27 MSD 2011


Hello!

On Thu, Apr 14, 2011 at 10:20:31AM -0400, slowgary wrote:

> The OS is Centos 5.6 (Final)

Looking though linux code and testing on the exactly same centos - 
it seems that linux may indeed return EADDRINUSE on listen().

But as far as I see the only situation when it may appear is two 
bind()'s on conflicting ports followed by two listen()'s.  Second 
listen() call will fail with EADDRINUSE.

This shouldn't happen in nginx unless you are running something 
with 3rd party patches (or there is some other programm doing 
bind()/listen() on the same ports, but this is racy and really 
unlikely to be reproduceable).

Could you please show full config (with all listen's - the only 
you've provided seems not contain ports you see in complaints at 
all...), "nginx -V" output and "nginx -t" output (this should be 
identical to "service nginx configtest", but just in case)?

Maxim Dounin



More information about the nginx mailing list