I run the supervisor as root:
sudo supervisord -c /etc/supervisor/supervisord.conf
Then I try to run supervisorctl:
(myapp)appuser@ip-172-31-21-65:~/appuser$ supervisorctl -c /etc/supervisor/supervisord.conf
The supervisor begins with the following message:
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 224
Attempting to run the second command as root was also unsuccessful. I understand that this is by design.
All the tips that I find say that I should specify my user as the user executing this command, but this is how I set everything up:
Here is the script file that I am using:
NAME="myapp"
DJANGODIR=/home/appuser/myapp
SOCKFILE=/home/appuser/myapp/gunicorn.sock
USER=appuser
GROUP=webdata
NUM_WORKERS=1
DJANGO_SETTINGS_MODULE=myapp.settings
DJANGO_WSGI_MODULE=myapp.wsgi
I'm not sure what it is? I think this may be a parameter GROUP, as I do not recognize this value. But if I comment on this, it does not seem to matter. How to fix this problem?
EDIT: supervisor, appuser GROUP, , .
supervisord.conf:
[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/super$
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TE$
[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/supervisor/conf.d/*.conf
:
[program:myapp]
command = /home/appuser/myapp/gunicorn_start.sh ; Command to start app
user = appuser ; User to run as
stdout_logfile = /home/appuser/myapp/logs/supervisor.log ; Where to write$
redirect_stderr = true ; Save stderr in the same log
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 ; Set UTF-8 as default encoding
:
>supervisord --version
3.0b2