Skip to content

Instantly share code, notes, and snippets.

@furins
Last active December 27, 2015 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save furins/7399041 to your computer and use it in GitHub Desktop.
Save furins/7399041 to your computer and use it in GitHub Desktop.
base supervisor config - replace "username" with your name (based on http://martinbrochhaus.com/solr.html setup, thanks Martin!)
;base supervisor config - replace "username" with your name (based on http://martinbrochhaus.com/solr.html setup, thanks Martin!)
[unix_http_server]
file=/home/username/tmp/supervisor.sock
[supervisord]
logfile=/home/username/my/logs/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile=/home/username/tmp/supervisord.pid
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///home/username/tmp/supervisor.sock
@furins
Copy link
Author

furins commented Nov 19, 2013

WEBFACTION_USER=username
MY_SUPERVISOR_CONF_ID=7399041
mkdir -p ~/my/logs
mkdir -p ~/my/tmp
mkdir ~/etc
cd ~/my/tmp
wget -O supervisor.conf.json https://api.github.com/gists/$MY_SUPERVISOR_CONF_ID && cat supervisor.conf.json|python -c 'import json,sys;obj=json.load(sys.stdin);print obj["files"]["supervisor.conf"]["content"]' > ~/etc/supervisord.conf
rm supervisor.conf.json
cd ~
sed -i 's/username/'"$WEBFACTION_USER"'/g' ~/etc/supervisord.conf

@furins
Copy link
Author

furins commented Nov 19, 2013

then extend include files with per-project settings (to include them in version control)

ACTUAL_PROJECT=projectname
echo " 
[include]
files = /home/"$WEBFACTION_USER"/webapps/"$ACTUAL_PROJECT"/"$ACTUAL_PROJECT"/etc/supervisor.ini
" >> ~/etc/supervisord.conf

See more at: http://stegelman.com/blog/post/moving-from-mod_wsgi-to-gunicorn-with-webfaction/#sthash.W2xpBQIN.dpuf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment