2012-09-01 8 views
12

私はスーパーバイザを含む自動展開を行い、デフォルトの設定パスで混乱させるようにしています。supervisor.confのデフォルトの場所

すべてのデプロイメント・スキームは、プリセットやリンクなしで/etc/supervisor/supervisor.conf/etc/supervisor/conf.d/を使用しています。また、apt-get経由でスーパーバイザ・パッケージをインストールした後でも、このパスは実際の設定例です。この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をaroudと仮定しています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 

conf.dディレクトリに置かれた任意の余分なファイルをロードするためにsupervisordの原因となります。

+0

ありがとうございました!私はパッケージのインストールが私のサーバー上で変わるものを改訂しました。理由は部分的にインストールされていたのです(おそらくpythonbrewが別の理由かもしれません)。 – mrjj

+0

ニースが見つかりました。私はubuntuのバージョンが/etc/supervisor/supervisor.confを探していたのかと不思議に思っていました。 – fthinker

1

あなたはピップを経由してスーパーバイザをインストールし、したがって、

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

の詳細については、を参照してくださいMartjinの答えにパッチを当てたバージョンの上precedanceを取っ

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

にパッチ未適用のバージョンを持っていたかもしれませんパッチ。パッケージには、それは部分的にしかインストールされた場合には、インストールを再実行すると

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オプションなしで起動された場合( を使用してアプリケーションに構成ファイル名 を明示的に指定するオプション)、アプリケーションは という名前のファイルを次の場所の指定された 注文。最初に見つかったファイルが使用されます。

  1. $ CWD/supervisord.conf
  2. $ CWDは/ etc/supervisord.conf(スーパーバイザー3.3.0以降)
  3. /etc/supervisord.conf /etc/supervisor/supervisord.conf (実行可能ファイルに対して)
  4. ../etc/supervisord.conf(実行に対して)
  5. ../supervisord.conf
関連する問題