1

I need to run two instances of spawn-fcgi on my FreeBSD 8.2 box - one for PHP and one for Python scripts. I can run them manually like this:

/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -- /usr/local/bin/php5-cgi
/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9001 -- /usr/local/bin/python

But I prefer having it enabled and configured in my /etc/rc.conf:

spawn_fcgi_enable="YES"
spawn_fcgi_app="/usr/local/bin/php5-cgi"
spawn_fcgi_bindaddr="127.0.0.1"
spawn_fcgi_bindport="9000"

Is it possible to enable two or more spawn-fcgi jobs in /etc/rc.conf? Do I have to create a copy of /usr/local/etc/rc.d/spawn-fcgi script and modify it to use slightly different param names like spawn_fcgi2_enable? I am curious if anyone has a working implementation because it should be a pretty common problem to solve. I am also willing to hear any other suggestions on running multiple spawn-fcgi instances automatically on startup.

Dyppl
  • 131
  • 4

1 Answers1

0

You can either copy the rc-script or modify it to read the parameters from rc.conf and loop over them.

Have a look at the port net/balance, I think this one uses the loop-approach. Maybe there you can copy the coding.