Welcome! Log In Create A New Profile


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

February 22, 2017 04:48PM
depending on the version you may want to look
for /etc/nginx/conf.d/default.conf, when i have been building servers (i
use salt for configuration management) i have in my state file that

- /etc/nginx/conf.d/default.conf

which will ensure the file does not exist immediately after install, and
when i startup my virtual hosts all is well.

Based on your statements that may/not be your issue, but something that bit
me and regardless...something is listening on port 80, when you get that
what does `sudo netstat -nap | grep LISTEN` show


On Wed, Feb 22, 2017 at 1:36 PM, sum-it <nginx-forum@forum.nginx.org> wrote:

> Hello All,
> I have another "bind() to failed (98: Address already in use)"
> issue.
> I am working on a minimal system including nginx only. System startup time,
> and readiness time are important points. Whilte testing I figured out
> sometime system boots up within 500ms and sometimes it takes around 3
> second. On further probing I find out nginx is taking different time to
> start up which costs me extra 2.5 Seconds. So I tested and figured out that
> error in those cases is "bind() to failed (98: Address already
> in
> use).
> Few of my observation here are,
> 1. No other process is using that port, there is no other web server or
> application running on the system.
> 2. The case is not only limited to nginx restart, where nginx might not be
> shutdown correctly and itself might be using that port. Nginx even fails
> during system start, in cases where it has caused longer boot time.
> 3. I use customized kernels, but that kernel shouldn't be culprit either
> because sometimes it works on that kernel as well. Another point here is
> failure in customized kernel is more often as compared to stock kernel. The
> ratio of failure in stock kernel is around 30% and in customized is 70% but
> system works on both and fails on both.
> 4. Start/Stop scripts always exit with success status "0".
> 5. I tested nginx in a restart loop, with a 1 second sleep before and after
> start and stop. Failure is random.
> 6. Worse, nginx is actually running even though error said bind failed. I
> can connect to it, access default web page, and it is listed in netstat as
> listening as well.
> Output of netstat -ntl is at: http://pastebin.com/26b6KNAZ
> Error Log is at: http://pastebin.com/w0y8aa9p
> This is one of the customized system, a derivative of debian, I am working
> on. System wise, everything is consistent. I use same kernel, same system
> image with same parameters and it works sometime and fails otherwise.
> nginx -t gives
> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
> nginx: configuration file /etc/nginx/nginx.conf test is successful
> So configuration shouldn't be a problem.
> configuration file is default and available at:
> http://pastebin.com/iRFfW3UE
> Process listing after nginx startup: http://pastebin.com/0vB19rLq
> Process listing after nginx stop: http://pastebin.com/iQafxjiF
> Any pointer to debug the issue would be very helpful.
> Regards,
> sum-it
> Posted at Nginx Forum: https://forum.nginx.org/read.
> php?2,272570,272570#msg-272570
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
nginx mailing list
Subject Author Posted

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

sum-it February 22, 2017 01:36PM

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

jeffdyke February 22, 2017 04:48PM

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

sum-it February 23, 2017 10:08AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 271
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready