FreeBSD fastcgi rc.d script

15 views
Skip to first unread message

Jon J

unread,
May 31, 2011, 3:02:08 PM5/31/11
to django...@googlegroups.com
It took me a bit to figure out the particulars of this, but I thought
I'd give it to the community, in case someone comes looking for the
same solution.


#!/bin/sh
#
# PROVIDE: myapp
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Notes on usage: Just adjust the location and name of your app as needed.


. /etc/rc.subr

name="myapp"
rcvar=`set_rcvar`

load_rc_config $name

#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
# SET THEM IN THE /etc/rc.conf FILE
#
myapp_enable=${myapp_enable-"NO"}
myapp_pidfile=${myapp_pidfile-"/var/run/myapp.pid"}

command_interpreter="/usr/local/bin/python2.7" #Set this to whatever
works for you
pidfile="${utility_pidfile}"
command="/path/to/app/manage.py"
command_args="runfcgi method=threaded host=127.0.0.1 port=3033 pidfile=$utility$
run_rc_command "$1"

Reply all
Reply to author
Forward
0 new messages