Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

 
discard

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.