diff --git a/config/production.pill b/config/production.pill index ecdda48e4..d700694c7 100644 --- a/config/production.pill +++ b/config/production.pill @@ -11,7 +11,7 @@ Bluepill.application(app_name) do |app| process.start_command = "bundle exec script/delayed_job -e production start" process.stop_command = "bundle exec script/delayed_job -e production stop" - process.pid_file = File.join('tmp', 'pids', 'delayed_job.pid') + process.pid_file = File.join(app.working_dir, 'tmp', 'pids', 'delayed_job.pid') end app.process("unicorn") do |process| @@ -22,7 +22,7 @@ Bluepill.application(app_name) do |app| process.start_command = "bundle exec unicorn -l /tmp/#{app_name}_unicorn.sock -c config/unicorn.rb -D" process.stop_command = "kill -QUIT {{PID}}" process.restart_command = "kill -USR2 {{PID}}" - process.pid_file = File.join('tmp', 'pids', 'unicorn.pid') + process.pid_file = File.join(app.working_dir, 'tmp', 'pids', 'unicorn.pid') process.monitor_children do |child_process| child_process.stop_command = "kill -QUIT {{PID}}" diff --git a/lib/recipes/bluepill.rb b/lib/recipes/bluepill.rb index ed2a8fd20..9f57e3bd0 100644 --- a/lib/recipes/bluepill.rb +++ b/lib/recipes/bluepill.rb @@ -3,7 +3,7 @@ Capistrano::Configuration.instance(:must_exist).load do set :bluepill_binary, "bundle exec bluepill --no-privileged" desc "Stop processes that bluepill is monitoring and quit bluepill" - task :quit, :roles => [:app] do + task :quit, :roles => [:app], :on_error => :continue do run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} stop APP_NAME=#{fetch :application}" run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} quit APP_NAME=#{fetch :application}" end diff --git a/lib/recipes/nginx.rb b/lib/recipes/nginx.rb index c4ab59ad6..9af0cbceb 100644 --- a/lib/recipes/nginx.rb +++ b/lib/recipes/nginx.rb @@ -8,7 +8,7 @@ Capistrano::Configuration.instance(:must_exist).load do task :generate_configuration, :roles => :web, :except => { :no_release => true } do config = %Q{ upstream #{application}_backend { - # server 127.0.0.1:#{unicorn_port}; + # server 127.0.0.1:#{unicorn_port rescue 8080}; server unix:/tmp/#{fetch :application}_unicorn.sock; }