2
1
I can't figure out how to run supervisorctl
correctly. There is a supervisord
running on my Ubuntu 16.04
server.
The supervisord.conf
path:
/home/django/Bedueno/supervisord.conf
When I run
supervisorctl
or
supervisorctl -c /home/django/Bedueno/supervisord.conf
console returns
django@Bedueno-beta-ubuntu-512mb-fra1-01:~$ supervisorctl -c /home/django/Bedueno/supervisord.conf
http://localhost:9001 refused connection
supervisor> reread
error: <class 'socket.error'>, [Errno 111] Connection refused: file: /usr/lib/python2.7/socket.py line: 575
supervisor>
Tried already with sudo
which didn't help.
Do you know where is the problem?
supervisord.conf
[program:daphne]
command=/home/django/Bedueno/beduenovenv/bin/daphne Bedueno.asgi:channel_layer --bind 0.0.0.0 -p 8001 ;
directory=/home/django/Bedueno/ ;
autostart=true ;
autorestart=true ;
[program:daphne_worker]
command=/home/django/Bedueno/beduenovenv/bin/python manage.py runworker ;
directory=/home/django/Bedueno/ ;
autostart=true ;
autorestart=true ;
[supervisord]
[supervisorctl]
EDIT
I realised I have two supervisord.pid and supervisord.log files.
Both of them are inside /tmp/
directory and in /home/django/Bedueno/
too. supervisor.sock
is only inside /tmp/
directory.
So the conf points to port
8001
and the connection error is based on port9001
.... seems like an issue to me, right? Be sure you are connecting to the correct port which is listening for the traffic. So--bind 0.0.0.0 -p 8001
in config but error states:9001 refused connection
. – Pimp Juice IT – 2018-02-19T20:22:17.587@PimpJuiceIT 8001 is a port fo daphne asgi. 9001 is supervisors port so it can't be the same in my opinion. – Milano – 2018-02-27T18:19:13.257
Okay, so from a web browser on the machine is applicable, see if you can access
http://localhost:8001
and also tryhttp://localhost:9001
. See if you can telnet into that port and confirm it's listening and usenetstat
as well to confirm the expected ports are listening on the server. I'm not an Linux expert yet so I was just pointing out the obvious from what I see in the detail you provided. I would test to confirm that the "expected" port is listening to start with next I suppose. – Pimp Juice IT – 2018-02-27T18:36:50.147telnet 127.0.0.1 9001 returns this: Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused and telnet 127.0.0.1 8001 Trying 127.0.0.1... Connected to 127.0.0.1. – Milano – 2018-02-27T18:42:33.227
Look over
netstat -ano
and see if you see any processes listening on those ports from the Local Address column from the ** Active Internet connections (servers and established)** section. You should see<IP Address>:<port>
in there somewhere so if it's not listening the something is not correct I would think like the server service is not running perhaps. – Pimp Juice IT – 2018-02-27T19:08:01.630There is nothing with port 9001. Tried also sudo netstat | grep 9001 which returned nothing. – Milano – 2018-02-27T19:16:57.667
Isn't the
– Pimp Juice IT – 2018-02-27T19:41:04.570[supervisorctl]
section and perhaps the[supervisord]
sections of the supervisord.conf file missing some parameters? Look over those sections per this here: http://supervisord.org/configuration.html and also read over http://supervisord.org/running.html if needed to just to ensure you don't see anything there that looks obvious. I think the configuration parameters are missing and maybe that's why it is not starting. Consider putting the logging level to trace or debug mode per that first link and looking over the logs when you try to start it.