Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Supervisorctl not respecting my configuration

Tags:

supervisord

I have set the following in /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

And started supervisord:

$ supervisord -c /home/david/conf/supervisor.conf

However how come supervisorctl still uses the default http://localhost:9001 as the serverurl?

$ supervisorctl
http://localhost:9001 refused connection
supervisor>

I checked /home/david/tmp and the files supervisord.log and supervisord.pid do exist.

like image 362
Jürgen Paul Avatar asked Jun 09 '13 00:06

Jürgen Paul


2 Answers

You should run supervisorctl with -c as well. From the documentation (my emphasis):

The Supervisor configuration file is conventionally named supervisord.conf. It is used by both supervisord and supervisorctl. If either application is started without the -c option (the option which is used to tell the application the configuration filename explicitly), the application will look for a file named supervisord.conf within the following locations, in the specified order. It will use the first file it finds.

  1. $CWD/supervisord.conf
  2. $CWD/etc/supervisord.conf
  3. /etc/supervisord.conf
like image 69
Burhan Khalid Avatar answered Nov 14 '22 20:11

Burhan Khalid


  • In MacOS, use brew to install
 brew install supervisor
  • Then go to /usr/local/etc/supervisord.ini and comment these lines:
;[unix_http_server]
;file=/usr/local/var/run/supervisor.sock   ; the path to the socket file

and uncomment these lines:

[inet_http_server]         ; inet (TCP) server disabled by default
port=127.0.0.1:9001        ; ip_address:port specifier, *:port for all iface
  • Finally restart the daemon:
brew services restart supervisor

That's all you need.

like image 44
Farshid Ashouri Avatar answered Nov 14 '22 18:11

Farshid Ashouri