Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ahamal
Revs
revs.init
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File revs.init of Package Revs
#! /bin/sh ### BEGIN INIT INFO # Provides: revs # Required-Start: networking mysql # Required-Stop: networking # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: Start FastCGI servers with Django. # Description: Django, in order to operate with FastCGI, must be started # in a very specific way with manage.py. This must be done # for each DJango web server that has to run. ### END INIT INFO # # Author: Guillermo Fernandez Castellanos # Version: @(#)fastcgi 0.1 11-Jan-2007 guillermo.fernandez.castellanos AT gmail.com # Altered by David Reynolds for Debian Stable (http://davidreynolds.me.uk/blog/2007/mar/16/django-fcgi-init-script/) # ...and altered further for revs #### SERVER SPECIFIC CONFIGURATION DJANGO_SITES="revs" RUNFILES_PATH=/var/run RUN_AS=www-data #### DO NOT CHANGE ANYTHING AFTER THIS LINE! set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="FastCGI servers" NAME=$0 SCRIPTNAME=/etc/init.d/$NAME # # Function that starts the daemon/service. # d_start() { # Starting all Django FastCGI processes PORT=$PORT_START for SITE in $DJANGO_SITES do echo -n ", $SITE" if [ -f $RUNFILES_PATH/$SITE.pid ]; then echo -n " already running" else startproc /usr/bin/django-admin.py runfcgi --settings=$SITE.settings daemonize=false \ method=threaded socket=$RUNFILES_PATH/$SITE.socket pidfile=$RUNFILES_PATH/$SITE.pid umask=000 fi chmod 0777 $RUNFILES_PATH/$SITE.socket done } # # Function that stops the daemon/service. # d_stop() { # Killing all Django FastCGI processes running for SITE in $DJANGO_SITES do echo -n ", $SITE" killproc -p $RUNFILES_PATH/$SITE.pid -TERM /usr/bin/django-admin.py \ || echo -n " not running" if [ -f $RUNFILES_PATH/$SITE.pid ]; then rm $RUNFILES_PATH/$SITE.pid fi if [ -f $RUNFILES_PATH/$SITE.socket ]; then rm $RUNFILES_PATH/$SITE.socket fi done } ACTION="$1" case "$ACTION" in start) echo -n "Starting $DESC: $NAME" d_start echo "." ;; stop) echo -n "Stopping $DESC: $NAME" d_stop echo "." ;; restart|force-reload) echo -n "Restarting $DESC: $NAME" d_stop sleep 1 d_start echo "." ;; *) echo "Usage: $NAME {start|stop|restart|force-reload}" >&2 exit 3 ;; esac exit 0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor