attached for real this time :)

On Mon, 3 Oct 2011, Todd T. Fries wrote:

> forgotten attachment.
> 
> Penned by Damien Miller on 20111003 10:12.37, we have:
> | Hi,
> | 
> | I use a few fcgi programs with lighttpd. You might be interested in
> | the attached rc.d script that I use to run them from rc.d(8). Here's
> | an example that uses it to run Mercurial's hgweb frontend:
> | 
> | ---------------------
> | 
> | #!/bin/sh
> | 
> | fcgi_prog="/var/www/hg.mindrot.org/hgweb.fcgi"
> | fcgi_sock="/var/www/run/hgweb.sock"
> | fcgi_pid="/var/www/run/hgweb.pid"
> | 
> | . /etc/rc.d/rc.fcgi
> | 
> | rc_cmd $1
> | 
> | ---------------------
> | 
> | I'm sure it could be polished further, but it works well enough for me.
> | It might be handy enough to include in the spawn-fcgi package.
> | 
> | -d
> 
> -- 
> Todd Fries .. [email protected]
> 
>  _____________________________________________
> |                                             \  1.636.410.0632 (voice)
> | Free Daemon Consulting, LLC                 \  1.405.227.9094 (voice)
> | http://FreeDaemonConsulting.com             \  1.866.792.3418 (FAX)
> | 2525 NW Expy #525, Oklahoma City, OK 73112  \  sip:[email protected]
> | "..in support of free software solutions."  \  sip:[email protected]
>  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
>                                                  
>               37E7 D3EB 74D0 8D66 A68D  B866 0326 204E 3F42 004A
>                         http://todd.fries.net/pgp.txt
> 
> 
#!/bin/sh

daemon="cd / ; /usr/local/bin/spawn-fcgi"
daemon_flags="-u _lighttpd -g _lighttpd"
daemon_flags="$daemon_flags -f $fcgi_prog"
daemon_flags="$daemon_flags -s $fcgi_sock"
daemon_flags="$daemon_flags -P $fcgi_pid"

. /etc/rc.d/rc.subr

rc_reload=NO

rc_start() {
        echo ${rcexec} "${daemon} ${daemon_flags} ${_bg}"
        ${rcexec} "${daemon} ${daemon_flags} ${_bg}"
}

rc_stop() {
        test -f $fcgi_pid || return 1
        pid=`cat $fcgi_pid`
        test "x$pid" = "x" && return 1
        kill $pid
}

rc_check() {
        test -f $fcgi_pid || return 1
        pid=`cat $fcgi_pid`
        test "x$pid" = "x" && return 1
        kill -0 $pid
}

Reply via email to