[Bug 1455921] Re: nginx fails to start during boot or upgrade with hostnames in 'listen' or 'upstream' bind commands.
Thomas Ward
teward at trekweb.org
Sun May 17 14:18:56 UTC 2015
Unfortunately, this is a (common) race condition between nginx at boot
and the system. It is also a common condition even when the system is
running. There are cases where nginx fails to resolve hostnames where
DNS resolvers don't know the information. It has been witnessed in the
past but there is no way to fix it.
>From the nginx-devel mailing list where i emailed on this issue with
regards to boot-time observation/replication of this problem
(http://mailman.nginx.org/pipermail/nginx-devel/2015-May/006944.html):
Quote: Maxim Dounin <mdounin at mdounin.ru>
To resolve names during configuration parsing nginx uses gethostbyname() or getaddrinfo() functions. It's up to the OS to provide appropriate service. That is, what you describe looks like a system startup race condition. I'm not really familiar with Debian/Ubuntu, but may be adding $named to Required-Start list in the init script will fix things.
This applies to other cases as well when the system is already running and there is a hostname resolution failure due to DNS problems or DNS servers being out of date, or your systems having cached DNS data.
An interesting case is when items are defined in /etc/hosts. This tends to 'work', but you lose the advantages of using a DNS server for the resolution. However, this is subject to the same system startup race conditions (observed on my own testing in 1.6.x, 1.7.x, and 1.8.x, and earlier versions of nginx as well.).
** Changed in: nginx (Ubuntu)
Status: Confirmed => Won't Fix
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nginx in Ubuntu.
https://bugs.launchpad.net/bugs/1455921
Title:
nginx fails to start during boot or upgrade with hostnames in 'listen'
or 'upstream' bind commands.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1455921/+subscriptions
More information about the Ubuntu-server-bugs
mailing list