22

Using Ubuntu 16.04 LTS to deploy my python app. Configured everything and the app is running manually. I want to automate it with supervisor, I have installed supervisor and configured it. But if I run:

Supervisor config file:

; 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

supervisorctl reread I end up with unix:///tmp/supervisor.sock no such file

But supervisord status is running,

Anyone having an idea, please.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Joseph Daudi
  • 1,557
  • 3
  • 17
  • 33
  • Try restarting the supervisord service. And also post output of `echo_supervisord_conf`. – Håken Lid Aug 30 '17 at 09:58
  • 1
    This Q **may** be more appropriate on the S.E. related site http://unix.stackexchange.com (Unix & Linux). Use the `flag` link at the bottom of your Q and ask the moderator to move it. Please don't post the same Q on 2 different sites. ***Please*** read http://stackoverflow.com/help/how-to-ask http://stackoverflow.com/help/dont-ask and http://stackoverflow.com/help/mcve before posting more Qs here. Good luck. – shellter Aug 30 '17 at 12:45

6 Answers6

36

Running this command sudo service supervisord restart solved my issue.

Some answers suggest re-installation, which is essentially doing this

Fermat's Little Student
  • 5,549
  • 7
  • 49
  • 70
15

Finally solved it by reinstalling supervisor after deleting all configuration files in /etc/supervisor/conf.d/ this did the trick.

Joseph Daudi
  • 1,557
  • 3
  • 17
  • 33
10

I had the same problem. After reading the man supervisorctl manual I realized the default file is /etc/supervisord.conf which in ubuntu is at /etc/supervisor/supervisord.conf. I created a symlink using:

sudo ln -s  /etc/supervisor/supervisord.conf /etc/supervisord.conf

This fixed my problem.

Shubham
  • 2,847
  • 4
  • 24
  • 37
mcgyver
  • 101
  • 1
  • 2
5

Reason of getting this: There is multiple reasons, what I found is that my supervisor was got corrupted due to the server going down continuously by power tripping.

solution: Remove the supervisor first and then reinstall it.

Steps:

sudo apt-get remove supervisor

sudo apt-get remove --auto-remove supervisor

sudo apt-get purge supervisor

sudo apt-get purge --auto-remove supervisor

Link for the above can be found here :

https://www.howtoinstall.co/en/ubuntu/trusty/supervisor?action=remove

Mayur Karmur
  • 2,119
  • 14
  • 35
3

The Ubuntu supervisor package (3.3.1-1.1) has the configuration file in /etc/supervisor/supervisord.conf.

For some reason (I don't know why) there appears to be another configuration file in /etc/supervisord.conf and supervisorctl prefers that file.

You can either define the configuration file location explicitly to supervisorctl:

sudo supervisorctl -c /etc/supervisor/supervisord.conf reread

or just remove /etc/supervisord.conf.

jarnoan
  • 4,309
  • 1
  • 19
  • 17
3

Probably one of the configuration files has syntax errors.

For instance, verify if [program] clause is missing

Remove each file on conf.d directory and restart supervisor to isolate the problematic file.

Josir
  • 1,282
  • 22
  • 35
  • This is right solution if there are no set up issues. This mostly shown up `supervisorctl` have not even initialised, copied wrong syntax error file. You can check `syslog` for more details. – Vish Feb 22 '20 at 14:35