supervisor.conf默认位置(supervisor.conf default locati

2019-07-31 07:02发布

我试着去让自动部署,包括supervisord和默认设置路径混淆。

每一个部署方案,我发现使用/etc/supervisor/supervisor.conf/etc/supervisor/conf.d/没有任何预设置和链接,还通过易于得到这条道路是真的示例配置充满安装监督员包后。

在这个例子流程看起来像这样没有任何联系,并建立类似的东西/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 ,以便在规定的手册

我尝试安装主管一切可能的办法,但我不能得到结果。

我知道,这只是小细节愚蠢,但我会在保持我的部署方案好你的帮助,非常感谢。

Answer 1:

一般情况下默认的文件确实是/etc/supervisor.conf ,但Debian发行版补丁此 (链接到作为由Debian提供的gzip压缩补丁)找/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):

因此,与该修补程序,监事查找supervisord.conf在本地目录中, etc/子目录,然后在全球/etc/supervisor//etc/目录。

默认supervisord.conf Debian是安装文件有这个底:

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

造成supervisord加载放在任何多余的文件conf.d目录。



Answer 2:

您可以通过PIP已安装主管,因此有未打补丁的版本

/usr/local/lib/python2.7/dist-packages/supervisor/

服用precedance过的补丁版本

/usr/lib/pymodules/python2.7/supervisor

见Martjin的有关补丁细节的答案。 简单的解决方法是:

pip uninstall supervisor

然后重新运行包的情况下安装只安装了一部分:

apt-get install supervisor

另外,还要确保你的/etc/supervisor/supervisord.conf存在。 如果没有,你可能需要手动重新创建它,我的是这样的:

; supervisor config file

[unix_http_server]
file=/var/run//supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run//supervisor.sock ; use a unix:// URL  for a unix socket

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

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


Answer 3:

从泽实际的文件: http://supervisord.org/configuration.html#configuration-file

监事配置文件通常命名为supervisord.conf。 它由两个supervisord和supervisorctl使用。 如果任何一个应用程序不带-c选项(这是用来告诉应用程序明确的配置文件名的选项)开始,应用程序将寻找一个下列地点内名为supervisord.conf文件,按照指定的顺序。 它将使用它找到的第一个文件。

  1. $ CWD / supervisord.conf
  2. $ CWD的/ etc / supervisord.conf
  3. /etc/supervisord.conf
  4. /etc/supervisor/supervisord.conf(因为主管3.3.0)
  5. ../etc/supervisord.conf(相对于可执行的)
  6. ../supervisord.conf(相对于可执行的)


文章来源: supervisor.conf default location