Alison Rowland
2006-May-30 19:44 UTC
[Mongrel] Getting /etc/mongrel_cluster and startup script to work?
Hi, I''m trying to setup my mongrel clusters to start on boot. I have followed the instructions under the "On Boot Initialization Setup" section at http://mongrel.rubyforge.org/docs/mongrel_cluster.html. When I try to start it up, I get the following error: me at mybox.com: sudo /etc/init.d/mongrel_cluster start Starting all mongrel_clusters... !!! Path to log file not valid: log/mongrel.log start reported an error. Use mongrel_rails start -h to get help. I have experimented with putting the full path to the log file in mongrel_cluster.yml, to no avail. mongrel_rails cluster::start works just fine when run from the app directory. Surely I must be missing something... any ideas? Thanks, Alison
Austin Godber
2006-May-30 19:54 UTC
[Mongrel] Getting /etc/mongrel_cluster and startup script to work?
Alison Rowland wrote:> Hi, > > I''m trying to setup my mongrel clusters to start on boot. I have > followed the instructions under the "On Boot Initialization Setup" > section at http://mongrel.rubyforge.org/docs/mongrel_cluster.html. > > When I try to start it up, I get the following error: > > me at mybox.com: sudo /etc/init.d/mongrel_cluster start > Starting all mongrel_clusters... > !!! Path to log file not valid: log/mongrel.log > start reported an error. Use mongrel_rails start -h to get help. > > I have experimented with putting the full path to the log file in > mongrel_cluster.yml, to no avail. mongrel_rails cluster::start works > just fine when run from the app directory. Surely I must be missing > something... any ideas?It sounds like the -c option didn''t work for you when configuring. This -c option needs to be set so that all the paths are relative to your apps root directory. When you run the "mongrel_rails cluster::configure" command make sure it looks like this: sudo mongrel_rails cluster::configure -e production -p 8000 -N 3 \ -c /usr/local/vhosts/testapp --user mongrel --group mongrel After you have run this, your config/mongrel_cluster.yml should look something like this: --- user: mongrel cwd: /usr/local/vhosts/testapp port: "8000" environment: development group: mongrel pid_file: log/mongrel.pid servers: 3 Again, its critical that the cwd: entry be present. Depending on your browser the mongrel_cluster page covers up part of that command with the news column. I will shorten that line. Thanks for your feedback and let me know how it goes. Austin
Alison Rowland
2006-May-31 19:14 UTC
[Mongrel] Getting /etc/mongrel_cluster and startup script to work?
Thanks, configuring with -c did the trick! But now I''ve got a different problem: I can''t get the startup script to work at system reboot. It''s in /etc/init.d, and it works like a charm when I call it from the command line. I''m on Ubuntu, and my system runlevel is 2. I used sysv-rc-conf (which I''ve successfully used before) to set it up, and I''ve confirmed that it''s symlinked (e.g. S20mongrel_cluster) in /etc/rc2.d. I have tried setting it to start before the webserver (Litespeed), and also after, to no avail. Upon restart, no mongrel, but it''ll start right up if I call it manually. Any ideas? Thanks. --Alison On May 30, 2006, at 3:54 PM, Austin Godber wrote:> Alison Rowland wrote: >> Hi, >> >> I''m trying to setup my mongrel clusters to start on boot. I have >> followed the instructions under the "On Boot Initialization Setup" >> section at http://mongrel.rubyforge.org/docs/mongrel_cluster.html. >> >> When I try to start it up, I get the following error: >> >> me at mybox.com: sudo /etc/init.d/mongrel_cluster start >> Starting all mongrel_clusters... >> !!! Path to log file not valid: log/mongrel.log >> start reported an error. Use mongrel_rails start -h to get help. >> >> I have experimented with putting the full path to the log file in >> mongrel_cluster.yml, to no avail. mongrel_rails cluster::start works >> just fine when run from the app directory. Surely I must be missing >> something... any ideas? > > It sounds like the -c option didn''t work for you when configuring. > This > -c option needs to be set so that all the paths are relative to your > apps root directory. > > When you run the "mongrel_rails cluster::configure" command make > sure it > looks like this: > > sudo mongrel_rails cluster::configure -e production -p 8000 -N 3 \ > -c /usr/local/vhosts/testapp --user mongrel --group mongrel > > After you have run this, your config/mongrel_cluster.yml should look > something like this: > > --- > user: mongrel > cwd: /usr/local/vhosts/testapp > port: "8000" > environment: development > group: mongrel > pid_file: log/mongrel.pid > servers: 3 > > Again, its critical that the cwd: entry be present. > > Depending on your browser the mongrel_cluster page covers up part of > that command with the news column. I will shorten that line. > > Thanks for your feedback and let me know how it goes. > > Austin > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
Austin Godber
2006-Jun-01 01:50 UTC
[Mongrel] Getting /etc/mongrel_cluster and startup script to work?
On 5/31/06, Alison Rowland <alisonrowland at fastmail.fm> wrote:> Thanks, configuring with -c did the trick! > > But now I''ve got a different problem: I can''t get the startup script > to work at system reboot. It''s in /etc/init.d, and it works like a > charm when I call it from the command line. I''m on Ubuntu, and my > system runlevel is 2. I used sysv-rc-conf (which I''ve successfully > used before) to set it up, and I''ve confirmed that it''s symlinked > (e.g. S20mongrel_cluster) in /etc/rc2.d. I have tried setting it to > start before the webserver (Litespeed), and also after, to no avail. > Upon restart, no mongrel, but it''ll start right up if I call it > manually. Any ideas? Thanks.Hmm ... take a look at your init script ... I bet it can''t find mongrel_cluster_ctl because its in /usr/local/bin ... try changing this: CONF_DIR=/etc/mongrel_cluster RETVAL=0 to this: CONF_DIR=/etc/mongrel_cluster PATH=/usr/local/bin:$PATH RETVAL=0 Just make sure you are adding the real path to mongrel_cluster_ctl. This solution should work I will bring this to Bradley''s attention so he can fix it in the distribution the way he sees fit. Let me know if this solves your problem. Austin
Alison Rowland
2006-Jun-01 14:09 UTC
[Mongrel] Getting /etc/mongrel_cluster and startup script to work?
Austin Godber wrote:> > Hmm ... take a look at your init script ... I bet it can''t find > mongrel_cluster_ctl because its in /usr/local/bin ... try changing > this: > CONF_DIR=/etc/mongrel_cluster > RETVAL=0 > > to this: > > CONF_DIR=/etc/mongrel_cluster > PATH=/usr/local/bin:$PATH > RETVAL=0Okay, solved it! mongrel_cluster_ctl is actually in /usr/bin on my machine, so the path wasn''t the problem. The actual problem was the shebang line, which read like this: #!/usr/bin/env ruby But on bootup (thanks to my hosting provider''s tech support guy for tipping me off on this), it was throwing this error: /usr/bin/env: ruby: No such file or directory Apparently, ruby is in the env for my logged-in user, but not for the machine at bootup time, so a quick change to the shebang line to make it #!/usr/bin/ruby1.8, and I''ve got mongrel starting up on reboot. I''ve still gotta figure out how to fix my env, but I guess that''s another issue. Thanks again for your help. --Alison
Kelly Felkins
2006-Oct-11 18:16 UTC
[Mongrel] Getting /etc/mongrel_cluster and startup script to work?
On 6/1/06, Alison Rowland <alisonrowland at fastmail.fm> wrote: snip But on bootup (thanks to my hosting provider''s tech support guy for> tipping me off on this), it was throwing this error: > > /usr/bin/env: ruby: No such file or directory >I''m probably having a similar problem, but I don''t know where to look. How did your tech support guy determine this? Is this in a log file? Sorry, my sysadmin skills are not the best. -Kelly -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061011/1a55324e/attachment-0001.html
Alison Rowland
2006-Oct-11 19:06 UTC
[Mongrel] Getting /etc/mongrel_cluster and startup script to work?
You need to log in via console-over-ssh (you''ll find this in your Rimu control panel), and restart your server. Then you''ll be able to see its boot process and any error messages thrown. --Alison On Wed, 11 Oct 2006 11:16:31 -0700, "Kelly Felkins" <railsinator at gmail.com> said:> On 6/1/06, Alison Rowland <alisonrowland at fastmail.fm> wrote: > snip > > But on bootup (thanks to my hosting provider''s tech support guy for > > tipping me off on this), it was throwing this error: > > > > /usr/bin/env: ruby: No such file or directory > > > > I''m probably having a similar problem, but I don''t know where to look. > How > did your tech support guy determine this? Is this in a log file? Sorry, > my > sysadmin skills are not the best. > > -Kelly-- Alison Rowland alisonrowland at fastmail.fm