[Mongrel] can't configure mongrel_cluster to start on boot

David Vrensk david at vrensk.com
Wed Nov 7 17:48:20 EST 2007


On Nov 7, 2007 9:13 PM, Tiberiu Motoc <tiberiu.motoc at gmail.com> wrote:

> Hi David,
>
> Thanks for all your help. It now makes sense how it all works.
>

Hi Tiberiu, thanks, I'm glad to hear that!


> Unfortunately for me it doesn't work and I don't think it is because
> of mongrel_cluster.
>
> After you mentioned that I should have a symbolic link to
> mongrel_cluster_ctl in /usr/bin,
>

Oops, did I say that?  I meant to say that the actual script
'mongrel_cluster_ctl' should reside in /usr/bin.  But I have to admit that
that was a simplification; the script should reside in the same directory as
the 'ruby' binary.

I realized that maybe the whole Ruby environment is not available at boot
> time. I installed Ruby in a shared location, but there are not symbolic
> links in /usr/bin to any of the Ruby utilities.
>

Well, there needn't be.  You can have you entire ruby installation in
/usr/local or /what/ever, as long as you put /usr/local/bin or
/what/ever/bin in your path.  Where is that shared location?  How do you
access it?  The reason I ask is that mongrel_cluster normally starts after
all network services have been started.  A typical FC6 box would have this
(and more) in /etc/rc3.d:

S10network (starts the network interface)
S25netfs  (mounts remote shares)
S28autofs  (starts the automounter)
S60nfs  (starts nfs sharing)
S85mongrel_cluster

And since the scripts are run in this order, remote shares should be
available.

 To test this, I created a small Ruby script which write "TEST" to a file in
> /tmp; I call this script from a bash script which I put in the /etc/init.d
> directory and which I configured using /sbin/chkconfig (similar to the setup
> of mongrel_cluster). Guess what?! No file is created in the /tmp directory
> at boot time.
>

Just to check: if you put

echo TEST > /tmp/my_test_script_runs

in the bash script, does that work as expected?  And second, do you call the
ruby script as a command or a script, i.e., do you say

my_script

or

ruby my_script

And finally, what does the script look like?

 So now my question becomes: what is the proper way of installing Ruby on a
> Linux machine? I did create a symbolic link to "ruby" in /usr/bin, but I
> don't think that's enough. What other symbolic links do I need?
>

You don't need any symbolic links as long as the bin directory is in your
path.  If you compile it on your own, it's quite common to put it /usr/local
since that is what 'configure' does by default.

The 'proper' way is a matter of taste.  If you enjoy being an admin, go
ahead and install everything from source and put it in /usr/local.  If you
don't, use your distro's package manager (yum, dep, apt, rpm, what have you)
and let it put things in /usr.  Arguing about which is best borders on
philosophy.

I still don't have a solution for you, but keep talking!

Good luck,

/David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20071107/41539ac1/attachment.html 


More information about the Mongrel-users mailing list