﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9182	Here's an rc.d script for FastCGI on BSD	kriskowal	nobody	"For: http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#lighttpd-setup

This script implements all the usual daemon control operations like ""start"", and ""stop"", and also starts ""fastcgi"" on boot before ""lighttpd"".

</usr/local/etc/rc.d/mond.sh>

{{{
#!/bin/sh

# PROVIDE: fastcgi
# BEFORE: lighttpd
# REQUIRE: DAEMON

. /etc/rc.subr
name=""fastcgi""
rcvar=`set_rcvar`

load_rc_config $name

: ${fastcgi_enable=""NO""}

command=python
host=localhost
port=3033
pidfile=/var/run/fastcgi.pid
sig_stop=""-INT""
sig_reload=""-INT""
start_cmd=start_cmd
stop_postcmd=stop_postcmd
reload_precmd=reload_precmd
reload_postcmd=reload_postcmd

start_cmd()
{
    DJANGO_SETTINGS_MODULE=.............settings \
    .............../django/bin/django-admin.py runfcgi \
        host=${host} \
        port=${port} \
        pidfile=${pidfile}
}

stop_postcmd()
{
    rm -f ${pidfile}
}

reload_precmd()
{
    echo ""Stoping ${name} and start gracefully.""
}

reload_postcmd()
{
    rm -f ${pidfile}
    run_rc_command start
}

run_rc_command ""$1""
}}}

"		closed	Documentation	1.0		wontfix			Design decision needed	0	0	0	0	0	0
