The big key there is to include --clean parameter. If something fails
and the pid is left in place, this will remove it on start. Here are
two tasks we use.
set :mongrel_config, "/location/to/mongrel_cluster_config.yml"
desc "Restart mongrel_cluster(which restarts rails)"
namespace :deploy do
task :restart do
sudo "mongrel_rails cluster::restart --clean -C #{mongrel_config}"
end
end
desc "Cold deploy start mongrel_cluster(which restarts rails)"
namespace :deploy do
task :start do
sudo "mongrel_rails cluster::start --clean -C #{mongrel_config}"
end
end
On 10/2/07, Jonathan Weiss <[EMAIL PROTECTED]> wrote:
>
> Jamis Buck wrote:
> > Is anyone here using cap2 with mongrel_cluster, and can give Jeff some
> > tips? We aren't using mongrel_cluster ourselves, so I don't know what to
> > say.
>
> This is what Webistrano uses:
>
> namespace :webistrano do
> namespace :mongrel do
> [ :stop, :start, :restart ].each do |t|
> desc "#{t.to_s.capitalize} mongrel"
> task t, :roles => :app, :except => { :no_release => true } do
> invoke_command "mongrel_rails cluster::#{t.to_s} -C
> #{mongrel_config} --clean", :via => run_method
> end
> end
> end
> end
>
> namespace :deploy do
> task :restart, :roles => :app, :except => { :no_release => true } do
> webistrano.mongrel.restart
> end
>
> task :start, :roles => :app, :except => { :no_release => true } do
> webistrano.mongrel.start
> end
>
> task :stop, :roles => :app, :except => { :no_release => true } do
> webistrano.mongrel.stop
> end
> end
> end
>
>
> --
> Jonathan Weiss
> http://blog.innerewut.de
>
> >
>
--
Thanks,
Greg Benedict
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---