2012-09-01 147 views
12

我试图进行自动部署,包括supervisord和默认设置路径混淆。supervisor.conf默认位置

我发现的每个部署方案都使用/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

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

我知道这只是一个很小的细节,但我会非常感谢您的帮助,以保持我的部署方案的良好。

回答

15

通常默认的文件确实是/etc/supervisor.conf,但Debian distribution patches this(链接到作为由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/目录中。 Debian是安装

默认supervisord.conf文件有这个底:

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

造成supervisord加载放在conf.d目录中的任何其他文件。

+0

非常感谢!我修改了我的服务器上安装的软件包的安装,所以原因是部分安装(也许pythonbrew是其他原因),并且补丁程序没有应用。 – mrjj

+0

很好找。我想知道ubuntu版本是如何寻找/etc/supervisor/supervisor.conf。 – fthinker

1

你可能已经通过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 
0

起泽实际的文件: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(相对于可执行)