views:

268

answers:

2

When deploying my Rails app via Capistrano, the very last thing it tries to execute is this:

sudo -p 'sudo password: ' -u app /home/user/public_html/example.com/current/script/process/reaper

Then it throws this error:

failed: "sh -c \"sudo -p 'sudo password: ' -u app /home/user/public_html/example.com/current/script/process/reaper\"" on 123.456.789.012

The app still deploys and starts fine...but what does process/reaper do and what can I do to get rid of the error?

+2  A: 

Before the Mongrel/Passenger epoch and before being build upon Rack, the only way to run a Rails application was using CGI or FGCI. The script/reaper file was used to start/stop a Rails process.

By default, Capistrano tries to start a new Rails process running the reaper script. You should customize the default behaviour.

Assuming you are running your Rails app using Passenger (mod_rails), install the following Capistrano + Passenger (mod_rails) recipe and Capistrano will gracefully restart your Passenger instance on deploy.

Simone Carletti
So can I just delete the script/process directory? I've already got my app deploying fine...just need to kill of that error. If that recipe is the only way to do it, cool. But just wondering if it's even easier to do.
Shpigford
Yes, you can. In fact, if you create a new Rails 2.3 project, that file won't be created.
Simone Carletti
A: 

Using rails 2.3 I added this to my config/deploy.rb

deploy.task :restart, :roles => :app do
  run "touch #{current_path}/tmp/restart.txt"
end

That stopped the reaper error and properly restart passenger.

Justin Tanner