2012-09-01 53 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(相對於可執行)