1

Usually I can reload my nginx configuration by typing sudo service nginx reload and everything is dandy. However, today I tried it and got reload: Not running I tried restarting nginx and at first I got a message saying there was no current instance running (which contradicted ps -ef, which had a PID matching /var/run/nginx.pid) and then seemingly started a new instance, though it didn't seem to do anything. Additionally, control of the reload command was not returned to me.

Anyone have any experience with this situation? It's a production machine, so I'm leery of messing with it without a better idea of what's going on and it's not clear how I could reproduce this on a test instance.

Thanks!

SapphireSun
  • 113
  • 3
  • any error log messages on reload? – return1.at May 11 '15 at 12:35
  • I've checked /var/log/nginx/error.log and /var/log/upstart/nginx.log.1.gz. There were some bind errors that looked like this in the upstart log: `nginx: [emerg] bind() to 0.0.0.0:88 failed (98: Address already in use)` It seems the log was created on May 8, which does seem to line up with when I last tried restarting it. – SapphireSun May 11 '15 at 15:44

1 Answers1

2

we had a similar problem on a testmachine after upgrading nginx from 1.6.3 to 1.8.0. the nginx error log showed entries like

bind() to 0.0.0.0:80 failed (98: Address already in use)
bind() to 0.0.0.0:443 failed (98: Address already in use)

we solved it with

sudo fuser -k 80/tcp
sudo fuser -k 443/tcp

on the production machine we stopped nginx before upgrading.

return1.at
  • 136
  • 3
  • Ah that was probably it. I ran apt-get upgrade and I believe I saw nginx-full in the list. Was trying to avoid downtime, but I opened a maintenance window and restarted nginx manually. Looks like that did the trick. :) Thanks! – SapphireSun May 12 '15 at 14:30