Restarting your rails application after deployment on Passenger
9 Sep 2009This is something that l always forget to add the first time l deploy my rails applications that run on Apache + Passenger.
namespace :deploy do
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :app do ; end
end
end
This will tell Capistrano to restart the server the passenger way by touching the restart.txt file in the tmp dir rather then trying to restart using mongrel. Lets hope l don't forget next time