2009
11.30

This is useful for Capistrano deployments when you need to start rake process which doesn’t run as daemon.

When you start daemons you will usually do this:

task :start_app, :roles => :app_servers do
        run "export RAILS_ENV=production && cd #{deploy_to}/current/ &&/usr/local/bin/rake app:start"
end

This may hold Capistrano session and prevent Capistrano to complete remaining tasks. Here is how you can prevent it:

task :start_app, :roles => :app_servers do
        run "export RAILS_ENV=production && cd #{deploy_to}/current/ && nohup /usr/local/bin/rake app:start >/dev/null 2>&1 &"
end

This is of course same as running any other kind of command:

user@computer:$ nohup COMMAND >/dev/null 2>&1 &
Bookmark and Share

No Comment.

Add Your Comment