another "bind() to 0.0.0.0:80 failed (98: Address already in use)" issue

sum-it nginx-forum at forum.nginx.org
Thu Feb 23 15:58:14 UTC 2017


Hello Jeff,

Thank you for your help. I tested your suggestion. This isn't the case. I
also tested in normal debian system and this wasn't the case there either. 


I believe following section is the culprit. Start-stop-daemon tests if
daemon was already running, however it doesn't relinquish the socket before
actually starting the daemon. This is good in case of normal service startup
where it returns "1" in those cases. For my case this costs me extra
2.5seconds which is huge for my otherwise normal .5 second system boot. 

start-stop-daemon --start --quiet --pidfile $PID --exec $DAEMON --test >
/dev/null \
        || return 1
start-stop-daemon --start --quiet --pidfile $PID --exec $DAEMON -- \
        $DAEMON_OPTS 2>/dev/null \
        || return 2

For now I commented first test since I am sure that no service is running in
my case, this is system boot and nginx will be only service running on this
system at port 80. For now everything works fine and results seems good. I
will post again if this broke anything. 

Best,
Sum-it

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,272570,272591#msg-272591



More information about the nginx mailing list