Open vkurup opened 8 years ago
Just to complicate this a little...
The above commands were from Duckling's staging server. I ran the same commands on Duckling's production server (identical OS, versions etc, just a larger machine) and they worked fine. So it seems that this issue may be intermittent from server to server...
What version of Nginx is running on those servers?
nginx version: nginx/1.8.1
on both staging and production.
Could this be only an issue for projects which were installed at 1.8.X vs those which were installed on an earlier version and later upgraded to 1.8.X. Grasping at straws here.
Hmmm... that is plausible. I could see how changing init scripts might mess things up. Staging was provisioned way before production, in this case.
That was it! Staging's nginx had been started before the PPA was installed. Once I manually killed the master process, then all the upstart commands started working normally.
Here's one way to tell if you're running an "old" master process:
vkurup$ ps auxw | grep 'nginx: master'
root 6920 0.0 0.2 75856 4408 ? S Feb01 0:00 nginx: master process /usr/sbin/nginx
The PPA version should have some command line parameters. It should look like this:
vkurup$ ps auxw | grep 'nginx: master'
root 18338 0.0 0.1 75864 3100 ? Ss 16:30 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
To fix it, kill the "old" process and then use the normal upstart commands:
vkurup$ sudo kill `cat /var/run/nginx.pid`
vkurup$ sudo reload nginx
It seems it would need a 1-time fix on any server that was running the Ubuntu-provided nginx and then upgraded to the PPA. Not sure if we should do that manually across our servers, or write something in salt to do it.
The annoying thing about this problem is that there's nothing wrong with these systems' configurations; they've just in a state they can't get themselves out of in the normal course of deploying to them. A simple reboot would sort it out.
The upstart script included with Nginx via the PPA doesn't work.
reload
fails with an incorrect error message.restart
claims to work but doesn't actually restart the processes:Possible workarounds:
nginx -s reload
for reloading (which I think is all we need in our case)