# Mongrel\_Cluster will not Initialise on Reboot

**URL:** <https://www.ruby-forum.com/t/mongrel-cluster-will-not-initialise-on-reboot/91791>\
**Category:** Deployment\
**Created:** [April 12, 2007, 11:54am UTC](https://www.ruby-forum.com/t/mongrel-cluster-will-not-initialise-on-reboot/91791 "2007-04-12T11:54:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [April 12, 2007, 11:54am UTC](https://www.ruby-forum.com/t/mongrel-cluster-will-not-initialise-on-reboot/91791/1 "2007-04-12T11:54:08Z")

</div>

Hi All,

Running Ubuntu Edgy Eft with Apache 2.2.4, mongrel (1.0.1) and  
mongrel\_cluster (1.0.1.1).

Apache works fine, both manual execute and reboot via /etc/init.d  
unfortunately Mongrel\_Cluster does not. If I execute;

$ sudo /etc/init.d/mongrel\_cluster start/stop/restart, it works fine but  
if the system reboots, /etc/init.d/mongrel\_cluster fails to initiate.

My Rails application is actually Radiant CMS and my mongrel\_cluster  
config lives at /var/www/radiant/config/mongrel\_cluster.yml.

=\> cat config/mongrel\_cluster.yml

user: mongrel  
cwd: /var/www/radiant  
log\_file: log/mongrel.log  
port: “8000”  
environment: production  
group: nogroup  
address: 127.0.0.1  
pid\_file: tmp/pids/mongrel.pid  
servers: 3

From /etc/init.d

=\> ls -al

-rwxr-xr-x 1 root root 1081 2007-04-12 08:25 mongrel\_cluster

From /usr/bin

=\> ls -al

-rwxr-xr-x 1 root root 371 2007-04-12 07:53  
mongrel\_cluster\_ctl  
-rwxr-xr-x 1 root root 348 2007-04-12 07:52 mongrel\_rails

From /etc/mongrel\_cluster

=\> ls -al

lrwxrwxrwx 1 root root 43 2007-04-12 08:24 mongrel\_cluster.yml →   
/var/www/radiant/config/mongrel\_cluster.yml

After reading through [Mongrel\_rails configuration file does not exist but it does - Deployment - Ruby-Forum](http://www.ruby-forum.com/topic/101919#new) it  
seems that my setup is correct yet it misbehaves.

Feedback appreciated, bdm.

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [April 12, 2007, 12:18pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-will-not-initialise-on-reboot/91791/2 "2007-04-12T12:18:10Z")

</div>

On 4/12/07, Ben M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> if the system reboots, /etc/init.d/mongrel\_cluster fails to initiate.

Did you create the service but never specify when/that it should start?  
See  
[http://www.cyberciti.biz/faq/howto-runlevel-configuration-tool-to-start-service/](http://www.cyberciti.biz/faq/howto-runlevel-configuration-tool-to-start-service/).

I’d also rename /etc/mongrel\_cluster/mongrel\_cluster.yml to  
radiant.yml or something like that.

HTH,  
Isak

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [April 12, 2007, 12:43pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-will-not-initialise-on-reboot/91791/3 "2007-04-12T12:43:51Z")

</div>

Hi Isak,

I installed ‘rcconf’ and ran it. ‘mongrel\_cluster’ was already in the  
init/rc.d scripts but good point anyway for future reference.

Wiped /etc/mongrel\_cluster, redid it and changed to ‘radiant.yml’.

Rebooted, still no ‘mongrel\_cluster’ init action.

Isak H. wrote:

> On 4/12/07, Ben M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > if the system reboots, /etc/init.d/mongrel\_cluster fails to initiate.
> 
> Did you create the service but never specify when/that it should start?  
> See  
> [http://www.cyberciti.biz/faq/howto-runlevel-configuration-tool-to-start-service/](http://www.cyberciti.biz/faq/howto-runlevel-configuration-tool-to-start-service/).
> 
> I’d also rename /etc/mongrel\_cluster/mongrel\_cluster.yml to  
> radiant.yml or something like that.
> 
> HTH,  
> Isak

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [April 13, 2007, 4:39pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-will-not-initialise-on-reboot/91791/4 "2007-04-13T16:39:42Z")

</div>

I seem to recall seeing someone with this problem and a blog post  
solution  
for FreeBSD … IIRC it had to do with ruby environment not being  
initialized correctly.

I think the shebang was `env ruby1.8` and needed to be explicitly set to  
/usr/bin/ruby…

At least that might give you enough to google on further … I don’t  
remember where I stumbled across that.

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [April 14, 2007, 1:23am UTC](https://www.ruby-forum.com/t/mongrel-cluster-will-not-initialise-on-reboot/91791/5 "2007-04-14T01:23:54Z")

</div>

Hank M. wrote:

> I seem to recall seeing someone with this problem and a blog post  
> solution  
> for FreeBSD … IIRC it had to do with ruby environment not being  
> initialized correctly.
> 
> I think the shebang was `env ruby1.8` and needed to be explicitly set to  
> /usr/bin/ruby…
> 
> At least that might give you enough to google on further … I don’t  
> remember where I stumbled across that.

Hi Hank,

This issue is fixed, I posted that above the entry before yours, sorry,  
it is a bit hard to see.

You are correct though, ‘mongrel\_cluster\_ctl’ requires #!/usr/bin/ruby  
to function correctly.

Thanks for your input,

Cheers bdm.

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [April 13, 2007, 7:59am UTC](https://www.ruby-forum.com/t/mongrel-cluster-will-not-initialise-on-reboot/91791/6 "2007-04-13T07:59:02Z")

</div>

Issue rectified.

Edit =\> /usr/bin/mongrel\_cluster\_ctl

Top line, change to =\> #!/usr/local/bin/ruby

Once complete, save & exit the file.

Ben M. wrote:

> Hi Isak,
> 
> I installed ‘rcconf’ and ran it. ‘mongrel\_cluster’ was already in the  
> init/rc.d scripts but good point anyway for future reference.
> 
> Wiped /etc/mongrel\_cluster, redid it and changed to ‘radiant.yml’.
> 
> Rebooted, still no ‘mongrel\_cluster’ init action.
> 
> Isak H. wrote:
> 
> > On 4/12/07, Ben M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > if the system reboots, /etc/init.d/mongrel\_cluster fails to initiate.
> > 
> > Did you create the service but never specify when/that it should start?  
> > See  
> > [http://www.cyberciti.biz/faq/howto-runlevel-configuration-tool-to-start-service/](http://www.cyberciti.biz/faq/howto-runlevel-configuration-tool-to-start-service/).
> > 
> > I’d also rename /etc/mongrel\_cluster/mongrel\_cluster.yml to  
> > radiant.yml or something like that.
> > 
> > HTH,  
> > Isak
