当用 supervisord 监视时,如何关闭 nginx 和 cron?

How can one shutdown nginx and cron when they are monitored with supervisord?

我正在尝试自动部署网络应用程序,更新应用程序需要关闭 cron 和 nginx。

问题是,当我通过 service nginx stopservice cron stop 停止进程时,它们会被 supervisord 重新启动。

supervisord没有init.d脚本,而且我不确定是否要使用supervisorctl来管理服务。

什么是正确的方法?

您需要为此使用 supervisorctl。但这只有在您的 supervisorconfig

中配置了 supervisorctl 时才有效

所以你需要使用

$ supervisorctl status

这将为您提供服务的名称,然后您可以使用

$ supervisorctl stop nginx-program
$ supervisorctl stop cron-program

这就是你应该如何处理它