带有主管的 Nginx 不断更改状态黑白运行和启动 [英] Nginx with Supervisor keep changing status b/w Running and Starting

查看:52
本文介绍了带有主管的 Nginx 不断更改状态黑白运行和启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是每 2 秒运行一次 supervisorctl status 的状态预览:

Here's a preview of the status running supervisorctl status every 2 seconds:

[root@docker] ~ # supervisorctl status
nginx                            RUNNING    pid 2090, uptime 0:00:02
[root@docker] ~ # supervisorctl status
nginx                            STARTING   
[root@docker] redis-2.8.9 # supervisorctl status
nginx                            RUNNING    pid 2110, uptime 0:00:01

对于 nginx 每隔几秒钟重新生成一次,这是正常的事情吗?知道 nginx 已设置为使用此设置在后台运行:

Is this a normal thing for nginx to respawn every few seconds ? Knowing that nginx is setup to be run in the background with this setup:

[program:nginx]
command=/usr/sbin/nginx
stdout_events_enabled=true
stderr_events_enabled=true

推荐答案

已经很久了,但它可能会帮助其他人...在您的 nginx 配置中设置 daemon off.Supervisord 要求进程不能作为守护进程运行.

Its been a long time, but it might help someone else... set daemon off in your nginx config. Supervisord requires processes not to run as daemons.

你也可以直接为supervisor命令设置:

You can also set it directly for the supervisor command:

command=/usr/sbin/nginx -g "daemon off;"

这篇关于带有主管的 Nginx 不断更改状态黑白运行和启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆