本文介绍了supervisor.conf默认位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使自动部署包括supervisord,并被默认的设置路径困惑。



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



在此中,流程看起来像这样没有任何链接和创建任何东西,如 /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 ,但(根据提供的链接到gzip压缩的补丁通过Debian查找 /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):
返回找到的配置文件的名称或者加注。
path = ['supervisord.conf','etc / supervisord.conf',
- '/etc/supervisord.conf']
+'/ etc / supervisor / supervisord .conf','/etc/supervisord.conf']
config =无
路径中的路径:
如果os.path.exists(路径):

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



Debian安装的默认 supervisord.conf 最后:

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

导致supervisord加载放在 conf.d 目录。


Im trying to make automatic deployment including supervisord and confused by default settings path.

Every deployment scheme I found use /etc/supervisor/supervisor.conf and /etc/supervisor/conf.d/ without any presettings and links, also, after installing supervisor package via apt-get this path is really filled by example configuration.

In this example flow looks like this without any links and creation anything like /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')

But in supervisorctl this path is not specified as default and it's assumed that default location somewhere aroud /etc/supervisor.conf so as specified in manual

I've try to install supervisor all possible ways but I can't get result.

I know that this is just small stupid detail, but I will be very grateful for your assistance in keeping my deployment scheme good.

解决方案

Normally the default file is indeed /etc/supervisor.conf, but the Debian distribution patches this (link to the gzipped patch as provided by Debian) to look for /etc/supervisor/supervisor.conf first:

--- 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):

So with that patch, supervisor looks for supervisord.conf in the local directory, in the etc/ subdirectory, then in the global /etc/supervisor/ and /etc/ directories.

The default supervisord.conf file installed by Debian has this at the end:

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

causing supervisord to load any extra files put in the conf.d directory.

这篇关于supervisor.conf默认位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-29 05:16