[Mongrel] mongrel_cluster rc.d script for FreeBSD

Andrew Bennett potatosaladx at gmail.com
Tue Aug 8 06:26:02 EDT 2006


Hey Carl,

On 8/7/06, Carl Lerche <carl.lerche at verizon.net> wrote:
> Thanks for the script. I use FreeBSD too so this is really useful.
> I'm not much of a shell script person though. What would I have to
> change in order to manage more than one clusters? (so that they all
> can start on boot).

Here's how I have things set up:

Create a directory at /usr/local/etc/mongrel_cluster and link your
mongrel configuration files under there (I'm including the commands
for reference, not to insult your intelligence):

user$ sudo mkdir /usr/local/etc/mongrel_cluster
user$ sudo ln -svf /home/rails/blog/config/mongrel_cluster.yml
/usr/local/etc/mongrel_cluster/blog.yml
user$ sudo ln -svf /home/rails/shop/config/mongrel_cluster.yml
/usr/local/etc/mongrel_cluster/shop.yml

Move my script to /usr/local/etc/rc.d/ and set permissions:

user$ sudo mv mongrel_cluster.sh /usr/local/etc/rc.d/
user$ sudo chmod 755 /usr/local/etc/rc.d/mongrel_cluster.sh

Add mongrel_cluster to /etc/rc.conf to run at startup:

user$ sudo vim /etc/rc.conf
(Add mongrel_cluster_enable="YES" where you want it to start up in the
order of things.  Optionally add mongrel_cluster_config="..." if you
decided to have your mongrel_cluster configuration in a differnet
location.)

Now start the clusters:

user$ sudo /usr/local/etc/rc.d/mongrel_cluster.sh start

And it should always startup on boot now.  If you apply my patch, you
can run things like:

user$ sudo /usr/local/etc/rc.d/mongrel_cluster.sh status

...to see if your clusters are running, what ports they are running
on, and what their process identifier (pid) numbers are.

Lemme know if you have any problems or questions, I hope this helps.

Andrew Bennett
potatosaladx at gmail.com


More information about the Mongrel-users mailing list