Tuesday, May 31, 2011

FreeBSD fastcgi rc.d script

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"

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate