ber*_*436 5 networking process services nginx
当我在 ubuntu 12.04 上像这样停止 nginx 时,出现以下错误:
$ sudo service nginx stop
Stopping nginx: nginx.
$sudo service nginx start
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Run Code Online (Sandbox Code Playgroud)
我必须用它来修复它。为什么停止服务不杀死nginx进程?这令人困惑!
默认情况下,start-stop-daemon 将 SIGTERM 发送到 nginx 进程。它不保证停止过程。修复:在/etc/init.d/nginx“停止”字符串部分的文件更改中
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
Run Code Online (Sandbox Code Playgroud)
到
start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --pidfile /var/run/$NAME.pid \
Run Code Online (Sandbox Code Playgroud)
如果 SIGTERM 不停止进程,该修复程序将发送 SIGKILL (kill -9)。
并请确保,pid-file pid /var/run/nginx.pid;in/etc/nginx/nginx.conf和 path --pidfile /var/run/$NAME.pidin/etc/init.d/nginx的路径相同。
| 归档时间: |
|
| 查看次数: |
14279 次 |
| 最近记录: |