Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano + NGINX Passenger Restart Rails App

I've finally gotten capistrano to work on my website, however, I cannot seem to get the restart part of the application to work. What I want todo is setup capistrano to restart the mongrel cluster that is running the rails app after a deploy has gone through. Since I used passenger to install everything, I have no clue how to restart the mongrel cluster.

Does anyone know how todo this? In each tutorial that I've read, it mentions that there should be a restart.txt file in the /tmp folder of the app, however I cannot find anything that explains how to restart it... or what to put in the file.

like image 656
matsko Avatar asked Oct 16 '10 07:10

matsko


1 Answers

I think adding this task to your deploy.rb file should do

namespace :deploy do
  task :restart do
    run "touch #{current_path}/tmp/restart.txt"
  end
end

Basically this will run the touch tmp/restart.txt in the rails root directory which will restart passenger

like image 78
Rishav Rastogi Avatar answered Sep 26 '22 08:09

Rishav Rastogi