I'm trying to deploy a django project using gunicorn/nginx as webserserver. The project works perfectly fine when I just run this command in virtualevn:
(.zenv)randi@server:/srv/myproj$ gunicorn --bind 127.0.0.1:8000 myproj.wsgi:application
However, when I add virtualenv activation & the above command to /etc/supervisor/conf.d/myproj.conf
:
[program:myproj]
directory = /srv/myproj
user = randi
command = source /home/randi/.zenv/bin/activate && gunicorn --bind 127.0.0.1:8000 myproj.wsgi:application
autorestart=true
redirect_stderr=true
stdout_logfile = /var/log/supervisor/access.log
stderr_logfile = /var/log/supervisor/error.log
after starting the supervisor supervisorctl start all
(as root), I get:
myproj: ERROR (abnormal termination)
and supervisor status
gives:
myproj FATAL Exited too quickly (process log may have details)
There is nothing in error logs to help. I have googled in vein and this problem has tripped my for a while. So I appreciate your help to resolve it.