-
Notifications
You must be signed in to change notification settings - Fork 4
/
django-supervisor-unicorn
40 lines (32 loc) · 1.2 KB
/
django-supervisor-unicorn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Supervisor
==========
Installation
sudo pip-2.7 install supervisor
(to setup pip-2.7 use https://github.com/vinodpandey/blog/blob/master/virtualenv-python2.7.3.sh)
echo_supervisord_conf > supervisord.conf
sudo cp supervisord.conf /etc/supervisord.conf
sudo ln -sfn /usr/local/bin/supervisord /usr/bin/supervisord
sudo ln -sfn /usr/local/bin/supervisorctl /usr/bin/supervisorctl
Sample config file
[program:gunicorn_website]
command=/vagrant/bin/python2.7 /vagrant/bin/gunicorn project.dev_wsgi:application --bind=0.0.0.0:8000 --workers 9
directory=/vagrant/website
user=vagrant
autostart=true
autorestart=true
stdout_logfile = /var/log/gunicorn/website-std.log
stderr_logfile = /var/log/gunicorn/website-err.log
supervisor commands
start
sudo /usr/bin/supervisord -c /etc/supervisord.conf
stop
sudo supervisorctl shutdown
status
sudo supervisorctl status
sudo supervisorctl start gunicorn_website
sudo supervisorctl stop gunicorn_website
ps aux | grep gunicorn_website
Error: Another program is already listening on a port that one of our HTTP servers is configured to use.
Solution: sudo unlink /tmp/supervisor.sock
Restarting supervisord
sudo supervisorctl shutdown