Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Supervisor socket error: Unlinking stale socket /tmp/supervisor.sock

I installed Supervisor on a shared Debian server. When I run: supervisord -c supervisord.conf I get this error continuously untill I kill it:Unlinking stale socket /tmp/supervisor.sock
When I run supervisorctl status I get:
unix:///tmp/supervisor.sock no such file
My supervisord.conf file like this (I didn`t change anything):

[unix_http_server]
file=/tmp/supervisor.sock     ; (the path to the socket file)
;chmod=0700                 ; socket file mode (default 0700)

[supervisord]
logfile=/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=/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                 ; (min. avail process descriptors;default 200)

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

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock   ; use a unix:// URL  for a unix socket

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/app/artisan queue:work  --sleep=3 --tries=3
autostart=true
autorestart=true
;user=
numprocs=8
redirect_stderr=true
stdout_logfile= /path/to/app/worker.log

When I cd to /tmp to look for the socket file, the socket looks like this: supervisor.sock.824804.
The six-digit number gets somehow generated randomly by the server after I run the supervisord -c supervisord.confcommand. Do I have to consider this six-digit in the supervisord.config file? And how to I do this, since it gets generated randomly? I have already installed and run Supervisor on a macOS Mojave too and there were no problemes and the socket file just locked like supervisor.sock. Thank for any help and suggestion in advance!

like image 740
Heinz Avatar asked Oct 20 '25 03:10

Heinz


2 Answers

I set nodaemon = true in supervisord.conf and that fixed my problem.

like image 89
Hashem Zargari Avatar answered Oct 22 '25 05:10

Hashem Zargari


unlink /tmp/supervisor.sock

then I fixed it "Unlinking stale socket /tmp/supervisord.sock".

like image 44
wangyongheng Avatar answered Oct 22 '25 04:10

wangyongheng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!