Skip to main content
 首页 » 编程设计

python之在虚拟环境中运行主管

2024年10月24日12lori

我在我的虚拟环境 (venv) 中安装了 supervisor 和 gunicorn。

我正在使用本教程:https://realpython.com/blog/python/kickstarting-flask-on-ubuntu-setup-and-deployment/

我不知道应该在哪里为 supervisor 创建 config 文件,因为默认的 etc/supervisor 不适用对我来说。

supervisorctl 文件在目录中:

/home/giri/venv/py2.7/lib/python2.7/site-packages/supervisor

我注意到 supervisorctl 文件中的这一行:

Options: 
-c/--configuration -- configuration file path (default /etc/supervisord.conf) 

每次运行 supervisorctl 脚本时是否需要手动设置此标志,还是有其他方法?

谢谢

请您参考如下方法:

如文档中所述 ( http://supervisord.org/configuration.html ):

The Supervisor configuration file is conventionally named supervisord.conf. It is used by both supervisord and supervisorctl. If either application is started without the -c option (the option which is used to tell the application the configuration filename explicitly), the application will look for a file named supervisord.conf within the following locations, in the specified order. It will use the first file it finds.

  • $CWD/supervisord.conf
  • $CWD/etc/supervisord.conf
  • /etc/supervisord.conf

因此,将 supervisor.conf 放在您当前的工作目录中就可以了。