]> git.kaiwu.me - nginx.git/commit
Workaround for "configuration file test failed" under OpenVZ.
authorGena Makhomed <gmm@csdoc.com>
Thu, 23 Jul 2015 18:00:03 +0000 (14:00 -0400)
committerGena Makhomed <gmm@csdoc.com>
Thu, 23 Jul 2015 18:00:03 +0000 (14:00 -0400)
commit97741382b6f22352413ed5bfb4787cfa74148bdf
tree07c083a99c79ea6b428429643d58f2b907183c98
parent29cebe5d63dc17514da2439b43b537a7780afb05
Workaround for "configuration file test failed" under OpenVZ.

If nginx was used under OpenVZ and a container with nginx was suspended
and resumed, configuration tests started to fail because of EADDRINUSE
returned from listen() instead of bind():

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use)
nginx: configuration file /etc/nginx/nginx.conf test failed

With this change EADDRINUSE errors returned by listen() are handled
similarly to errors returned by bind(), and configuration tests work
fine in the same environment:

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

More details about OpenVZ suspend/resume bug:
https://bugzilla.openvz.org/show_bug.cgi?id=2470
src/core/ngx_connection.c