Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 -p 9000 -- /usr/local/bin/php5-cgi
/usr/local/bin/spawn-fcgi -a -p 9001 -- /usr/local/bin/python

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


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.

share|improve this question

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.

share|improve this answer
www/nginx also supports 'jobs' – sendmoreinfo Aug 12 '12 at 13:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.