Chcę zatrzymać Nginx, ale tak się nie udaje.
$ sudo service nginx stop
Stopping nginx: [FAILED]
I nginx.confto określa miejsce, w którym nginx.pid ma linię.
# /etc/nginx/nginx.conf
pid /var/run/nginx.pid;
Ale nie ma nginx.pidtego katalogu /var/run/.
locate nginx.pid pokazuje ten wynik.
/var/run/nginx.pid
/var/run/nginx.pid.oldbin
Ale po updatedbtym nie ma dopasowania do wyszukiwania. Używam nginx / 1.4.4 w CentOS release 6.5 (Final).
Co powinienem zrobić, aby zatrzymać demona nginx?
Edytuj 2014/01/07
Jest to wyjście ps -ef | grep nginxwydaje nginx demon wciąż działa.
ironsand 17065 16933 0 15:55 pts/0 00:00:00 grep --color nginx
root 19506 1 0 2013 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
ironsand 19507 19506 0 2013 ? 00:00:25 nginx: worker process
I sudo service nginx restartdaje ten błąd. Myślę, że się nginxnie uruchamia, bo stary wciąż żyje. I /var/log/nginx/error.log-2014017zawiera również ten błąd.
Stopping nginx: [FAILED]
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[FAILED]
pspolecenia.
ps -ef | grep nginxlubsudo netstat -tlnp | grep nginx.