Answer the question
In order to leave comments, you need to log in
Has anyone encountered the problem of restarting nginx?
Sometimes the system fails to restart nginx. The most annoying thing about all this is "sometimes".
Currently installed on the server:
Debian GNU/Linux 7 (wheezy)
nginx/1.2.1 (пакет nginx-extras [nginx web/proxy server (extended version)])
2014/05/06 07:03:04 [emerg] 3176#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/05/06 07:03:04 [emerg] 3176#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/05/06 07:03:04 [emerg] 3176#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/05/06 07:03:04 [emerg] 3176#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/05/06 07:03:04 [emerg] 3176#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/05/06 07:03:04 [emerg] 3176#0: still could not bind()
listen [::]:80 default_server;
[email protected]:/etc# netstat -tnlp | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 10307/nginx
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 11605/apache2
Answer the question
In order to leave comments, you need to log in
Tags: start-stop-daemon, shit.
We solved this problem by adding kill -9 at the end of the nginx init script, if it does not die in a few seconds.
start-stop-daemon returns that everything is OK, but in reality, nginx has not yet closed all connections (and has not killed processes).
incorrect debian startup/restart scripts
Try to install the latest version from the Nginx repositories directly.
look in /etc/init.d/nginx where he puts nginx.pid, if he has rights to this location, and if the file appears there after launch.
Because when the process stops, it takes from this file, if the file does not exist, it reports that everything is stopped.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question