gpt4 book ai didi

python - supervisor.conf 默认位置

转载 作者:IT老高 更新时间:2023-10-28 21:18:41 28 4
gpt4 key购买 nike

我正在尝试进行自动部署,包括 supervisord 和默认设置路径混淆。

我发现的每个部署方案都使用 /etc/supervisor/supervisor.conf/etc/supervisor/conf.d/ 没有任何预设和链接,也,之后通过 apt-get 安装 supervisor 包 这个路径实际上是由示例配置填充的。

在此example流程看起来像这样,没有任何链接和创建任何类似 /etc/supervisor.conf:

sudo('apt-get -y install supervisor')
put('config/supervisor_gunicorn.conf', '/etc/supervisor/conf.d/gunicorn.conf', use_sudo=True)
sudo('supervisorctl reload')

但在 supervisorctl 中,此路径未指定为默认路径,并且假定默认位置位于 /etc/supervisor.conf 周围某处,因此在 manual 中指定

我尝试了所有可能的方式安装主管,但我无法获得结果。

我知道这只是一些愚蠢的小细节,但我将非常感谢您帮助我保持良好的部署计划。

最佳答案

通常默认文件确实是/etc/supervisor.conf,但是Debian distribution patches this (链接到 Debian 提供的 gzipped 补丁)首先查找 /etc/supervisor/supervisor.conf:

--- supervisor-3.0a8.orig/src/supervisor/options.py
+++ supervisor-3.0a8/src/supervisor/options.py
@@ -105,7 +105,7 @@
def default_configfile(self):
"""Return the name of the found config file or raise. """
paths = ['supervisord.conf', 'etc/supervisord.conf',
- '/etc/supervisord.conf']
+ '/etc/supervisor/supervisord.conf', '/etc/supervisord.conf']
config = None
for path in paths:
if os.path.exists(path):

因此,使用该补丁,supervisor 在本地目录中查找 supervisord.conf,在 etc/ 子目录中,然后在全局 /etc/supervisor//etc/ 目录。

Debian 安装的默认 supervisord.conf 文件末尾有这个:

[include]
files = /etc/supervisor/conf.d/*.conf

导致 supervisord 加载放在 conf.d 目录中的任何额外文件。

关于python - supervisor.conf 默认位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12226113/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com