Supervisorctl error: unix:///var/run/supervisord.sock refused connection?

Sometimes supervisor configuration file is not automatically generated after installation and you have to write it manually:

echo_supervisord_conf > /etc/supervisord.conf
sudo supervisord -c /etc/supervisord.conf
sudo supervisorctl status

Your [supervisorctl] serverurl should be "unix:///var/run/supervisord.sock", since "/var/run/supervisord.sock" is not a valid URI for xmlrpclib to connect to.


I had this issue and found that it occurred after a server restart. When supervisor tried to restart afterwards, it couldn't find the log directory that was specified in my daemon config file (this problem didn't appear while supervisor was running).

All I needed to do was change the stdout_logfile path (or comment out the line) in my file:

(swap the ##### for your file id)

sudo nano /etc/supervisor/conf.d/daemon-#####.conf

Add an existing log file path or comment the line out with a # at the start of the line:

#stdout_logfile=/my/bad/log/directory

Then restart supervisor

sudo service supervisor restart