[Mongrel] problem restarting mongrel_cluster outside RAILS_ROOT - patch and other option

Michael Steinfeld mikeisgreat at gmail.com
Tue Apr 17 11:36:27 EDT 2007


Well, I have fought this so many times, and another issue that comes
up is if you had fastcgi previously in use before migrating to
mongrel.

I have spent countless hours trying to deal with the mongrel pids and
stopping and starting after each deploy. I lost the battle. I can
start/stop manually using the /etc/init.d/mongrel_cluster script
without fail.

I am attempting to offer a fifth option here which I have not yet put
into effect but plan to if I can't find any other solution. Wayne's
solutiion has not worked for me and setting the full path in
mongrel_cluster.yml has not worked either.

This is not the most advised approach I am sure.. but it will work
with a little tweaking. Then again I don't want my app to be down
during each deploy... *sighs
---------------
desc "Kill all the pids in case there are some zombies and remove
the .pid files"
task :before_before_deploy, :roles => :app do
  begin
    run "sudo kill -9 `ps -ef | grep mongrel | egrep -v grep | awk
'{print $2}'`"
    run "cd #{previous_release}/logs && sudo rm -rf *.pid"
  end

task :after_after_deploy, :roles => :app do
  begin
    " sudo /etc/init.d/mongrel_cluster start"
  end

--------------

This is probably overkill, but I ran out of patience.

Let me know what you guys think.

--mike

On 4/17/07, Wayne E. Seguin <wayneeseguin at gmail.com> wrote:
> Matte,
> On Apr 17, 2007, at 00:09 , Matte Edens wrote:
> > "sudo mongrel_rails cluster::restart -C [valid path to config] --
> > clean"
>
> Is this really a problem with mongrel cluster?
>
> A "fourth" solution is to simply modify your restart task in your
> Capistrano recipe:
>
> task :restart, :roles => :app do
>    run(or sudo) "cd #{current_path}; mongrel_rails cluster::restart -
> C [valid path to config] --clean"
> end
>
> ~Wayne
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>


-- 
-mike


More information about the Mongrel-users mailing list