# Mongrel startup

**URL:** <https://www.ruby-forum.com/t/mongrel-startup/84762>\
**Category:** Deployment\
**Created:** [February 7, 2007, 3:28pm UTC](https://www.ruby-forum.com/t/mongrel-startup/84762 "2007-02-07T15:28:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [February 7, 2007, 3:28pm UTC](https://www.ruby-forum.com/t/mongrel-startup/84762/1 "2007-02-07T15:28:47Z")

</div>

Hello.

I have mongrel working perfectly, other than it doesn’t start when my  
server reboots (not good). So my setup is this.

I have the mongrel\_cluster startup file in /usr/local/etc/rc.d/ and  
then a directory of symlinks to my rails apps in /usr/local/etc/  
mongrel\_cluster/ named whatever.yml

When I run the script from the command line ./mongrel\_cluster start it  
works perfectly.

Any suggestions or where to look for problems?

---

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [February 7, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/mongrel-startup/84762/2 "2007-02-07T16:20:41Z")

</div>

jcontonio wrote:

> Hello.
> 
> I have mongrel working perfectly, other than it doesn’t start when my  
> server reboots (not good). So my setup is this.
> 
> I have the mongrel\_cluster startup file in /usr/local/etc/rc.d/ and  
> then a directory of symlinks to my rails apps in /usr/local/etc/  
> mongrel\_cluster/ named whatever.yml
> 
> When I run the script from the command line ./mongrel\_cluster start it  
> works perfectly.
> 
> Any suggestions or where to look for problems?

you have to add the mongrel\_cluster\_ctl to the init programs/scripts  
(these run at reboot).

check out the linux-command

update-rc.d # this adds the script to run on reboot

i think.  
-s

---

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [February 7, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/mongrel-startup/84762/3 "2007-02-07T16:30:57Z")

</div>

This would work if I was running linux.

I am running FreeBSD.

---

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [February 7, 2007, 8:40pm UTC](https://www.ruby-forum.com/t/mongrel-startup/84762/4 "2007-02-07T20:40:28Z")

</div>

On 2/7/07, jcontonio [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> When I run the script from the command line ./mongrel\_cluster start it  
> works perfectly.
> 
> Any suggestions or where to look for problems?

mongrel\_cluster works great but if your going to use Monit to monitor  
your system as it can handle this for you as a by-product of checking  
a mongrel’s status.

Here are some pasties that are good examples:

[http://p.caboo.se/17981](http://p.caboo.se/17981)  
[http://pastie.caboo.se/13355](http://pastie.caboo.se/13355)

–  
Zack C.  
[http://depixelate.com](http://depixelate.com)

---

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [September 25, 2007, 11:01pm UTC](https://www.ruby-forum.com/t/mongrel-startup/84762/5 "2007-09-25T23:01:26Z")

</div>

This is also wrong. I have no rc.local in /etc or /usr/local/etc.

There is rc.conf in /etc/ which I had mongrel\_cluster\_enable=“YES” so  
I tried changing it to mongrel\_cluster\_ctl\_enable=“YES”

Still a no go.

/usr/sbin/inetd start -c /usr/local/etc/mongrel\_cluster

That is what’s running on boot when I check the current processes, but  
it’s not using a config file so it’s not working.

Again. running the command in /usr/local/etc/rc.d/mongrel\_cluster  
start

works from command line…

But on boot it does nothing but run this

/usr/sbin/inetd start -c /usr/local/etc/mongrel\_cluster

---

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [September 25, 2007, 11:03pm UTC](https://www.ruby-forum.com/t/mongrel-startup/84762/6 "2007-09-25T23:03:31Z")

</div>

I’m not too familiar with the rc.d style configuration files, so I  
can’t diagnose your problem. It appears that the startup script is  
trying to run your command from the incorrect directory.

/etc/rc.local does in fact still work in FreeBSD, even if the file is  
not there. Just create the file, paste your command, and it will work.

The rc man page will confirm that this is the case.  
([rc](http://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+6.2-RELEASE&format=html))

Reading the man page may give you a clue as to what is wrong with your  
current setup.

– Wes
