--- /dev/null
+[supervisord]
+logfile = /var/log/supervisord.log
+logfile_maxbytes = 10MB
+logfile_backups = 5
+loglevel = info
+pidfile = /var/run/supervisord.pid
+
+[supervisorctl]
+serverurl = unix:///var/run/supervisor.sock
+
+[unix_http_server]
+file = /var/run/supervisor.sock
+chmod = 0777
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
+
+[program:gunicorn]
+command=/var/www/karmaworld/manage.py run_gunicorn -c confs/prod/gunicorn.conf
+autostart = true
+autorestart = true
+redirect_stderr = true
+stopsignal = QUIT
+
+[program:celeryd]
+command=/var/www/karmaworld/manage.py celery worker --pidfile=/var/www/karmaworld/var/run/celeryd.pid -l info
+autorestart = true
+redirect_stderr = true
+stdout_logfile=/var/log/celeryd.log
+priority = 2
+stopsignal = QUIT
+
env.proj_root = '/var/www/karmaworld'
env.branch = 'prod'
env.code_root = '{0}/{1}-code'.format(env.proj_root, env.branch)
+env.supervisor_conf = '{0}/confs/{1}/supervisord-root.conf'.format(env.code_root, env.branch))
######## Define host(s)
def here():
"""
Starts supervisord
"""
- virtenv_exec('supervisord -c {0}/confs/{1}/supervisord.conf'.format(env.code_root, env.branch))
+ virtenv_exec('supervisord -c {0}'.format(env.supervisor_conf))
@task
"""
Restarts supervisord
"""
- config_file = '/var/www/karmaworld/confs/prod/supervisord.conf'
- virtenv_exec('supervisorctl -c %s shutdown' % config_file)
+ virtenv_exec('supervisorctl -c {0} shutdown'.format(env.supervisor_conf))
@task
defined in supervisord.conf and the action that should
be performed on it: start|stop|restart.
"""
- supervisor_conf = '/var/www/karmaworld/confs/prod/supervisord.conf'
- virtenv_exec('supervisorctl -c %s %s %s' % (supervisor_conf, action, process))
+ virtenv_exec('supervisorctl -c {0} {1} {2}'.format(env.supervisor_conf, action, process))
@task