Created
September 17, 2011 00:04
-
-
Save fdelbos/1223429 to your computer and use it in GitHub Desktop.
A FreeBSD startup script for starting Gunicorn workers
This file contains 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 characters
#!/bin/sh | |
# | |
# PROVIDE: gunicornd | |
# | |
# Filename: gunicornd | |
# Author: Frederic DELBOS - [email protected] | |
# Created: Sat Sep 17 00:29:58 2011 (+0200) | |
# Last-Updated: Sat Sep 17 02:04:02 2011 (+0200) | |
# By: Frederic DELBOS - [email protected] | |
# Update #: 15 | |
# | |
# | |
. /etc/rc.subr | |
name="gunicornd" | |
rcvar=`set_rcvar` | |
start_cmd="${name}_start" | |
stop_cmd=":" | |
load_rc_config $name | |
gunicornd_start() | |
{ | |
export PYTHON_EGG_CACHE=/tmp | |
if checkyesno ${rcvar}; then | |
cd /home/django/www/mydjangoapp; | |
/usr/local/bin/gunicorn_django --workers=2 --bind=127.0.0.1:8000 --max-request=1024 --user=django; | |
fi | |
} | |
load_rc_config $name | |
run_rc_command "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much. This saved my day.