#9182: Here's an rc.d script for FastCGI on BSD
---------------------------+------------------------------------------------
 Reporter:  kriskowal      |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Documentation  |     Version:  1.0       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 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"
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9182>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to