Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / spawn-fcgi / doc / run-generic
blob78417e676f7ab22d6ffdcf4269d869b898babeff
1 #!/bin/bash
2 # Use this as a run script with daemontools or runit
4 ## ABSOLUTE path to the spawn-fcgi binary
5 SPAWNFCGI="/usr/bin/spawn-fcgi"
7 ## ABSOLUTE path to the FastCGI application (php-cgi, dispatch.fcgi, ...)
8 FCGIPROGRAM="/usr/bin/php5-cgi"
10 ## bind to unix socket
11 FCGISOCKET="/var/run/lighttpd/your-fcgi-app.sock"
13 # allowed environment variables separated by spaces
14 ALLOWED_ENV="PATH USER"
16 ## if this script is run as root switch to the following user
17 USERID=xxx
18 SOCKUSERID=www-data
19 #CHROOT=/home/www/
21 #RAILS_ENV="production"
22 #export RAILS_ENV
25 ################## no config below this line
27 exec 2>&1
29 if test x$PHP_FCGI_CHILDREN = x; then
30 PHP_FCGI_CHILDREN=4
33 ALLOWED_ENV="$ALLOWED_ENV RAILS_ENV"
35 if test x$UID = x0; then
36 EX="$SPAWNFCGI -n -s $FCGISOCKET -u $USERID -U $SOCKUSERID -C $PHP_FCGI_CHILDREN -- $FCGIPROGRAM"
37 else
38 EX="$SPAWNFCGI -n -s $FCGISOCKET -C $PHP_FCGI_CHILDREN -- $FCGIPROGRAM"
41 # copy the allowed environment variables
44 for i in $ALLOWED_ENV; do
45 E="$E $i=${!i}"
46 done
48 # clean environment and set up a new one
49 exec env - $E $EX