yougov / velociraptor

BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

NginxBalancer doesn't detect failures in nginx reload #214

Open bdeeney opened 7 years ago

bdeeney commented 7 years ago

The default reload command used by NginxBalancer:

/etc/init.d/nginx reload

exits with return code 0 when it aborts the reload because it has detected a problem with the nginx configuration. This can lead to a situation in which VR believes that the latest nginx configuration has been loaded by the balancer, when in fact the balancer continues to run using an older configuration.

A better default reload command for this balancer would be:

/usr/sbin/nginx -t && /etc/init.d/nginx reload