Forked from m0n5t3r/gunicorn-upstart.conf.template
Created
March 20, 2012 21:31
Revisions
-
DavidWittman revised this gist
Mar 20, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # %(mysite)s - run %(mysite)s instances (default is the prod instance) # # This runs gunicorn-django for %(mysite)s; to install: # * sudo ln -s <this file> /etc/init/%(mysite)s @@ -25,7 +25,7 @@ # * sudo start/stop/restart/reload/status %(mysite)s # * sudo start/stop/restart/reload/status %(mysite)s instance=testing description "%(mysite)s gunicorn instance, default is the prod instance" start on runlevel [2345] stop on runlevel [06] -
DavidWittman revised this gist
Mar 20, 2012 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,38 +30,38 @@ description "%(mysite)s gunicorn instance, default is the main instance" start on runlevel [2345] stop on runlevel [06] expect daemon respawn respawn limit 10 5 instance ${instance:-prod} env APPHOME="/home/%(mysite)s/public_html" env USER="django" pre-start script INST=${instance:-prod} GUNICORN="$APPHOME/env/bin/gunicorn_django" test -n "$GUNICORN" -a -x "$GUNICORN" || { stop; exit 0; } test -d "$APPHOME" || { stop; exit 0; } end script script INST=${instance:-prod} CONF="$APPHOME/$INST/conf/gunicorn_$INST.conf.py" GUNICORN="$APPHOME/env/bin/gunicorn_django" PIDFILE="$APPHOME/$INST/run/$INST.pid" LOGFILE="$APPHOME/$INST/log/gunicorn.log" cd "$APPHOME/$INST/app" exec $GUNICORN --pid="$PIDFILE" --name="$INST" --user="$USER" --group="$USER" --config="$CONF" --daemon --log-file="$LOGFILE" 2>>"$LOGFILE" end script post-stop script INST=${instance:-prod} rm -rf "$APPHOME/$INST/run/$INST".{pid,sock} end script -
m0n5t3r revised this gist
Feb 14, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,6 +50,7 @@ end script script INST=${instance:-main} CONF="$APPHOME/$INST/conf/gunicorn_$INST.conf.py" GUNICORN="$APPHOME/env/bin/gunicorn_django" PIDFILE="$APPHOME/$INST/run/$INST.pid" LOGFILE="$APPHOME/$INST/log/gunicorn.log" -
m0n5t3r revised this gist
Jul 30, 2010 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ env APPHOME="/home/%(mysite)s/public_html" pre-start script INST=${instance:-main} GUNICORN="$APPHOME/env/bin/gunicorn_django" test -n "$GUNICORN" -a -x "$GUNICORN" || { stop; exit 0; } test -d "$APPHOME" || { stop; exit 0; } @@ -55,7 +55,7 @@ script LOGFILE="$APPHOME/$INST/log/gunicorn.log" cd "$APPHOME/$INST/app" source "$APPHOME/" exec $GUNICORN --pid="$PIDFILE" --name="$INST" --user=django --group=django --config="$CONF" --daemon --log-file="$LOGFILE" 2>>"$LOGFILE" end script -
m0n5t3r created this gist
Jul 30, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,67 @@ # %(mysite)s - run %(mysite)s instances (default is the main production instance) # # This runs gunicorn-django for %(mysite)s; to install: # * sudo ln -s <this file> /etc/init/%(mysite)s # * sudo initctl reload-configuration # # it expects the following directory layout: # # /home/%(mysite)s/public_html # \-env -> virtualenv # | \-bin # | \-gunicorn_django # | \-activate # \-<instance> # | \-app -> application # | \-conf # | | \-gunicorn_<instance>.conf.py # | | \-<this file> # | \-log -> logs # | \-run -> pid files and the like # \-<instance> # ... # # to use: # * sudo start/stop/restart/reload/status %(mysite)s # * sudo start/stop/restart/reload/status %(mysite)s instance=testing description "%(mysite)s gunicorn instance, default is the main instance" start on runlevel [2345] stop on runlevel [06] expect fork respawn respawn limit 10 5 instance ${instance:-main} env APPHOME="/home/%(mysite)s/public_html" pre-start script INST=${instance:-main} GUNICORN="$APPHOME/env/bin/gunicorn_django" test -n "$GUNICORN" -a -x "$GUNICORN" || { stop; exit 0; } test -d "$APPHOME" || { stop; exit 0; } end script script INST=${instance:-main} CONF="$APPHOME/$INST/conf/gunicorn_$INST.conf.py" PIDFILE="$APPHOME/$INST/run/$INST.pid" LOGFILE="$APPHOME/$INST/log/gunicorn.log" cd "$APPHOME/$INST/app" source "$APPHOME/" exec $GUNICORN --pid="$PIDFILE" --name="$INST" --user=django --group=django --config="$CONF" --daemon --log-file="$LOGFILE" 2>>"$LOGFILE" end script post-stop script INST=${instance:-main} rm -rf "$APPHOME/$INST/run/$INST".{pid,sock} end script # vim: set et sw=4 ts=4 sts=4