I can’t get supervisord to work; after starting the process with:
# supervisord -n -c /etc/supervisord.conf
2013-05-29 11:34:11,861 CRIT Supervisor running as root (no user in config file)
2013-05-29 11:34:11,868 INFO supervisord started with pid 7893
From another terminal, I get:
# supervisorctl -c supervisord.conf status
error: <class 'socket.error'>, [Errno 2] No such file or directory: file: <string> line: 1
Running in vagrant, CentOS 6.3 x86_64.
Configuration:
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=500MB ; (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=/var/run/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 ; (min. avail process descriptors;default 200)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
nocleanup=false
umask=022
[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
[include]
files = /etc/supervisord.d/*.ini
Trying to find the socket file:
# ls /var/run/supervisor.sock
ls: cannot access /var/run/supervisor.sock: No such file or directory
Versions etc:
# rpm -qi supervisor
Name : supervisor Relocations: (not relocatable)
Version : 2.1 Vendor: Fedora Project
Release : 8.el6 Build Date: Fri 02 Jul 2010 10:14:29 AM EDT
Install Date: Wed 29 May 2013 09:55:23 AM EDT Build Host: x86-18.phx2.fedoraproject.org
Group : System Environment/Base Source RPM: supervisor-2.1-8.el6.src.rpm
Size : 1164337 License: ZPLv2.1 and BSD and MIT
Signature : RSA/8, Fri 02 Jul 2010 12:36:46 PM EDT, Key ID 3b49df2a0608b895
Packager : Fedora Project
URL : http://www.plope.com/software/supervisor2/
Summary : A System for Allowing the Control of Process State on UNIX
Description :
The supervisor is a client/server system that allows its users to control a
number of processes on UNIX-like operating systems.
Kinda shocked about supervisor. I get this error
unix:///var/run/supervisor.sock no such file
What is so shocking is the file is there! I am running on ubuntu on ec2. I tired to chmod to 0777 as well.
[supervisord]
logfile=/var/log/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=debug ; (log level;default info; others: debug,warn,trace)
pidfile=/var/run/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 ; (min. avail process descriptors;default 200)
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
[include]
files = *.supervisor
asked Jan 22, 2013 at 1:23
TampaTampa
1901 gold badge1 silver badge5 bronze badges
2
I know this question is kinda old but for the sake of others who happen to land to this problem, starting the supervisor daemon works for me.
sudo service supervisor start
A more detailed explanation is that in general, when you encounter a «unix:///var/run/blabla.sock no such file» error, most likely the issue is that the daemon of the program in subject (supervisord
in this case) wasn’t started and thus wasn’t able to generate the expected unix socket supervisor.sock
file. This file is the communication endpoint for the supervisor foreground commands (such as supervisorctl
) that acts as a tunnel/middleman responsible for relaying user-issued commands (ex. supervisorctl reread
) to the supervisor service running in background.
You can refer to Unix Domain Socket and to this stackoverflow answer.
answered Jun 26, 2017 at 14:46
AldeeAldee
1312 bronze badges
this was my problem, not sure if it helps. Aparently «service supervisord start
» doesn’t necessarily load your config file, or even a config file at all. In order to make mine work, I had to do a supervisord -c /path/to/my/config.conf
(i.e. run the binary directly) this fixed everything.
Rui F Ribeiro
54.8k26 gold badges144 silver badges221 bronze badges
answered Mar 8, 2015 at 19:08
RyanRyan
1393 bronze badges
I ran into this problem recently and I fixed it by following the following processes
or $ supervisorctl start
And that’s it.
answered Jun 26, 2019 at 10:23
Introduction
Actually, this is also another article discussing about how to solve an error message. This is actually not an error message where the solving step is in a specific action or solution. Instead, there is a sequence on executing the supervisor command before a certain command can work normally. Before further going on, supervisor itself is a tool where it is is a client/server system. It allows its users to monitor and control several processes on UNIX-like operating systems. Furthermore, it is also useful to control processes and it is an utility to to start program or service at boot time. There is an article for further reference in installing supervisor tool. It exist in this link with the title of ‘How to Install supervisord in Linux CentOS 7’. The following is the actual command execution which is causing the error message to appear :
[root@localhost etc]# supervisorctl reread error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib64/python2.7/socket.py line: 224 [root@localhost etc]#
After the installation of the supervisor tool is a success, there is an additional step to change the supervisor configuration file. Normally, that yum configuration file exist in /etc/yum.conf. It is a command execution after configuring or changing the supervisor configuration file exist by adding the following entries in the bottom part of the file with the ‘program:gunicorn’ block :
... ... ... [program:gunicorn] directory=/home/django/project/myapps command=/home/django/project/env/bin/gunicorn --workers 3 --bind unix:/home/django/project/myapps/apps.sock apps.wsgi:application autostart=true autorestart=true stderr_logfile=/var/log/gunicorn/gunicorn.out.log stdout_logfile=/var/log/gunicorn/gunicorn.err.log user=root group=django environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 [group:guni] programs:gunicorn
Well, it does not have any direct impact to the error appear, but the command ‘supervisorctl reread’ is a command useful to instruct supervisor to read again the changes exist in the supervisor configuration file.
Actually, the contnet
Solution
So, the problem which is causing the problem above is just a matter of command sequence execution. In this case, there is a command execution using ‘supervisor’. Apparently, the solution is very simple. The error appear as soon as the installation of ‘supervisor’ is in a success as in the article in this link, changing the supervisor configuration file and execution the ‘supervisor reread’ command to instruct supervisor to read the changes exist in it. But in order for supervisor to do that, the supervisor service must be active and running while in this case it is not. This is a simple mistake where the supervisor service is not active and triggering the error. So, the solution is very easy. Just make sure the supervisor service is running. If it is not, just run the command for running the supervisor service. The command ‘supervisorctl reread’ will run properly if the supervisor service is currently running. So, run it as below :
[root@localhost ~]# systemctl start supervisord [root@localhost ~]# systemctl status supervisord ● supervisord.service - Process Monitoring and Control Daemon Loaded: loaded (/usr/lib/systemd/system/supervisord.service; disabled; vendor preset: disabled) Active: active (running) since Thu 2021-11-25 16:54:22 UTC; 3s ago Process: 2206 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=0/SUCCESS) Main PID: 2209 (supervisord) CGroup: /system.slice/supervisord.service ├─2209 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf ├─2219 /home/django/project/env/bin/python /home/django/project/env/bin/gunicorn --workers 3 --bind unix:/home/django/project/myapps/apps.sock apps.wsgi:appl... ├─2222 /home/django/project/env/bin/python /home/django/project/env/bin/gunicorn --workers 3 --bind unix:/home/django/project/myapps/apps.sock apps.wsgi:appl... └─2224 /home/django/project/env/bin/python /home/django/project/env/bin/gunicorn --workers 3 --bind unix:/home/django/project/myapps/apps.sock apps.wsgi:appl... Nov 25 16:54:22 localhost systemd[1]: Starting Process Monitoring and Control Daemon... Nov 25 16:54:22 localhost systemd[1]: Started Process Monitoring and Control Daemon. [root@localhost log]# supervisorctl reread No config updates to processes [root@localhost log]#