2012-09-01 29 views
12

Im cố gắng triển khai tự động bao gồm cả giám sát và bị nhầm lẫn bởi đường dẫn cài đặt mặc định.supervisor.conf location mặc định

Mỗi lược đồ triển khai tôi thấy sử dụng /etc/supervisor/supervisor.conf/etc/supervisor/conf.d/ mà không có bất kỳ cài đặt trước và liên kết nào, sau khi cài đặt gói giám sát qua apt-get đường dẫn này thực sự được điền bằng cấu hình ví dụ.

Trong dòng chảy example này trông như thế này mà không cần bất kỳ liên kết và tạo ra bất cứ điều gì như /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') 

Nhưng trong supervisorctl con đường này không được quy định như mặc định và nó cho rằng vị trí mặc định ở đâu đó aroud /etc/supervisor.conf nên theo quy định tại manual

Tôi đã cố gắng cài đặt người giám sát tất cả các cách có thể nhưng tôi không thể nhận được kết quả.

Tôi biết rằng đây chỉ là chi tiết nhỏ ngu ngốc, nhưng tôi sẽ rất biết ơn sự hỗ trợ của bạn trong việc duy trì chương trình triển khai của tôi tốt.

Trả lời

15

thường file mặc định thực sự là /etc/supervisor.conf, nhưng Debian distribution patches this (liên kết đến các bản vá đã giải nén theo quy định của Debian) để tìm kiếm /etc/supervisor/supervisor.conf đầu tiên:

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

Vì vậy, với bản vá đó, người giám sát sẽ tìm kiếm supervisord.conf trong thư mục địa phương, trong thư mục con etc/, sau đó trong danh bạ toàn cầu /etc/supervisor//etc/.

Các supervisord.conf tập tin mặc định được cài đặt bởi Debian có này ở cuối:

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

gây supervisord để tải bất kỳ tập tin thêm đặt trong thư mục conf.d.

+0

Cảm ơn bạn rất nhiều! Tôi sửa đổi những gì cài đặt gói thay đổi trên máy chủ của tôi, vì vậy lý do là nó được cài đặt một phần (có thể pythonbrew là lý do có thể cái gì khác) và các bản vá không được áp dụng. – mrjj

+0

Rất đẹp. Tôi đã tự hỏi làm thế nào phiên bản ubuntu đang tìm kiếm /etc/supervisor/supervisor.conf. – fthinker

1

Bạn có thể đã cài đặt giám sát qua pip và do đó có phiên bản chưa được vá trong

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

tham precedance so với phiên bản vá trong

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

trả lời Xem Martjin để biết chi tiết trên vá. Giải pháp đơn giản là:

pip uninstall supervisor

Sau đó chạy lại gói cài đặt trong trường hợp nó đã được cài đặt chỉ một phần:

apt-get install supervisor

Ngoài ra hãy chắc chắn /etc/supervisor/supervisord.conf của bạn là hiện tại.Nếu không, bạn có thể cần phải tự tạo lại nó, tôi trông như thế này:

; 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

Từ ze tài liệu thực tế: http://supervisord.org/configuration.html#configuration-file

Các tập tin cấu hình Supervisor được quy ước đặt tên supervisord.conf. Nó được sử dụng bởi cả supervisord và supervisorctl. Nếu ứng dụng được bắt đầu mà không có tùy chọn -c (tùy chọn được sử dụng để cho ứng dụng biết tên tệp cấu hình một cách rõ ràng), ứng dụng sẽ tìm kiếm tệp có tên supervisord.conf trong các vị trí sau, theo quy định gọi món. Nó sẽ sử dụng tập tin đầu tiên mà nó tìm thấy.

  1. $ CWD/supervisord.conf
  2. $ CWD/etc/supervisord.conf
  3. /etc/supervisord.conf
  4. /etc/supervisor/supervisord.conf (kể từ Supervisor 3.3.0)
  5. ../etc/supervisord.conf (Liên quan đến thực thi)
  6. ../supervisord.conf (Liên quan đến thực thi)