我在/home/david/conf/supervisor.conf中设置了以下内容:

[unix_http_server]
file=/home/david/tmp/supervisor.sock

[supervisord]
logfile=/home/david/tmp/supervisord.log  ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB                    ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10                       ; (num of main logfile rotation backups;default 10)
loglevel=info                            ; (log level;default info; others: debug,warn,trace)
pidfile=/home/david/tmp/supervisord.pid  ; (supervisord pidfile;default supervisord.pid)
nodaemon=false                           ; (start in foreground if true;default false)
minfds=1024                              ; (min. avail startup file descriptors;default 1024)
minprocs=200
childlogdir=/home/david/tmp

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///home/david/tmp/supervisor.sock

并启动supervisord:
$ supervisord -c /home/david/conf/supervisor.conf

但是,supervisorctl为什么仍然使用默认的http://localhost:9001作为serverurl
$ supervisorctl
http://localhost:9001 refused connection
supervisor>

我检查了/home/david/tmp,并且文件supervisord.logsupervisord.pid确实存在。

最佳答案

您也应该同时运行supervisorctl-c。从文档(我的重点)中:

关于supervisord - Supervisorctl不尊重我的配置,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17005404/

10-11 15:41