6

我已经尝试通过 nginx 发送信号。我试过杀死所有进程,但它们似乎又回来了。

$ which nginx
/opt/local/sbin/nginx

$ sudo nginx -s stop

$ sudo /opt/local/sbin/nginx -s stop

$ ps -ef | grep nginx
141:    0 24627     1   0  2:29PM ??         0:00.00 nginx: master process /opt/local/sbin/nginx
142:   -2 24628 24627   0  2:29PM ??         0:00.02 nginx: worker process
143:   -2 24629 24627   0  2:29PM ??         0:00.07 nginx: worker process
144:   -2 24630 24627   0  2:29PM ??         0:00.07 nginx: worker process
145:   -2 24631 24627   0  2:29PM ??         0:00.07 nginx: worker process
146:   -2 24632 24627   0  2:29PM ??         0:00.07 nginx: worker process
147:   -2 24633 24627   0  2:29PM ??         0:00.07 nginx: worker process
148:   -2 24634 24627   0  2:29PM ??         0:00.07 nginx: worker process
149:   -2 24635 24627   0  2:29PM ??         0:00.07 nginx: worker process
150:   -2 24636 24627   0  2:29PM ??         0:00.07 nginx: worker process
151:   -2 24637 24627   0  2:29PM ??         0:00.07 nginx: worker process
167:    0 24924     1   0  2:36PM ??         0:00.01 /opt/local/bin/daemondo --label=nginx --start-cmd /opt/local/sbin/nginx ; --pid=fileauto --pidfile /opt/local/var/run/nginx/nginx.pid
168:    0 24925 24924   0  2:36PM ??         0:00.00 (nginx)
169:    0 24926     1   0  2:36PM ??         0:00.00 nginx: master process /opt/local/sbin/nginx
170:   -2 24927 24926   0  2:36PM ??         0:00.00 nginx: worker process
171:   -2 24928 24926   0  2:36PM ??         0:00.00 nginx: worker process
172:   -2 24929 24926   0  2:36PM ??         0:00.00 nginx: worker process
173:   -2 24930 24926   0  2:36PM ??         0:00.00 nginx: worker process
174:   -2 24931 24926   0  2:36PM ??         0:00.00 nginx: worker process
175:   -2 24932 24926   0  2:36PM ??         0:00.00 nginx: worker process
176:   -2 24933 24926   0  2:36PM ??         0:00.00 nginx: worker process
177:   -2 24934 24926   0  2:36PM ??         0:00.00 nginx: worker process
178:   -2 24935 24926   0  2:36PM ??         0:00.00 nginx: worker process
179:   -2 24936 24926   0  2:36PM ??         0:00.00 nginx: worker process
205:  502 24939 24879   0  2:36PM ttys010    0:00.00 grep -n nginx

我已经尝试杀死这些进程,但它们又出现了。

如何一劳永逸地停止 nginx?

4

2 回答 2

6

你得到了答案,但只是为了清楚,也许可以帮助别人:

OS X 应该为您重新启动 nginx 进程(将其作为系统服务运行,这是您大部分时间想要的)。所以你需要告诉launchd停止使用命令为你管理这个过程sudo launchctl unload <plist-filepath>,在我的例子中是:

sudo launchctl unload /Library/LaunchDaemons/dev.nginx.plist

于 2014-11-09T11:17:57.270 回答
3

daemondo正在重新启动 nginx。

不幸的是,没有太多关于在线使用它的信息,而且我没有在这台计算机上安装它,但是daemondo --help应该提供一些关于如何阻止它重新启动的指示nginx

于 2012-07-05T22:08:11.243 回答