namespace :deploy do desc "Restart Unicorn" task :restart do on roles(:app) do execute "kill -QUIT `cat #{deploy_to}/pids/unicorn.pid`; true" execute "kill -QUIT `cat #{shared_path}/pids/unicorn.pid`; true" execute "kill -QUIT `cat #{shared_path}/tmp/pids/unicorn.pid`; true" execute "cd #{release_path} && bundle exec unicorn -c config/unicorn.rb -E production -D" end end end