From 3ab92c0281896ad98b7dcc55d971c7451a70a040 Mon Sep 17 00:00:00 2001 From: Pavel Chipiga Date: Tue, 6 Dec 2011 21:33:35 +0200 Subject: [PATCH] Fix more configs. Refs #2261 --- config/deploy.rb | 11 ++++++----- lib/recipes/unicorn.rb | 12 ++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index f4b872b2c..350a5edd8 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -42,16 +42,17 @@ namespace :deploy do end task :symlink_all, :roles => :web do - # run "mkdir -p #{fetch :shared_path}/config" - # Never do this!!! - # run "yes y | cp -i #{fetch :release_path}/config/database.yml.sample #{fetch :shared_path}/config/database.yml" - # run "yes y | cp -i #{fetch :release_path}/config/application.yml.sample #{fetch :shared_path}/config/application.yml" - + run "mkdir -p #{fetch :shared_path}/config" + run "cp -n #{fetch :release_path}/config/database.yml.sample #{fetch :shared_path}/config/database.yml" + run "cp -n #{fetch :release_path}/config/application.yml.sample #{fetch :shared_path}/config/application.yml" run "ln -nfs #{fetch :shared_path}/config/database.yml #{fetch :release_path}/config/database.yml" run "ln -nfs #{fetch :shared_path}/config/application.yml #{fetch :release_path}/config/application.yml" + run "mkdir -p #{fetch :shared_path}/downloads" run "ln -nfs #{fetch :shared_path}/downloads/ #{fetch :release_path}/public/downloads" + run "mkdir -p #{fetch :shared_path}/tmp" + run "ln -nfs #{fetch :shared_path}/pids/ #{fetch :shared_path}/tmp/pids" run "ln -nfs #{fetch :shared_path}/tmp/ #{fetch :release_path}/tmp" run "mkdir -p #{fetch :release_path}/tmp/mount" run "mkdir -p #{fetch :release_path}/tmp/umount" diff --git a/lib/recipes/unicorn.rb b/lib/recipes/unicorn.rb index b94cc4c4e..d313dd942 100644 --- a/lib/recipes/unicorn.rb +++ b/lib/recipes/unicorn.rb @@ -9,18 +9,18 @@ Capistrano::Configuration.instance(:must_exist).load do run "cd #{fetch :current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -p #{unicorn_port} -E #{rails_env} -D" end task :stop, :roles => :app, :except => { :no_release => true } do - run "#{try_sudo} kill `cat #{unicorn_pid}`" + run "#{try_sudo} kill `cat #{unicorn_pid}`" rescue warn 'deploy:stop FAILED' end task :graceful_stop, :roles => :app, :except => { :no_release => true } do - run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`" + run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`" rescue warn 'deploy:graceful_stop FAILED' end task :reload, :roles => :app, :except => { :no_release => true } do - run "#{try_sudo} kill -s USR2 `cat #{unicorn_pid}`" + run "#{try_sudo} kill -s USR2 `cat #{unicorn_pid}`" rescue warn 'deploy:reload FAILED' end task :restart, :roles => :app, :except => { :no_release => true } do - reload - # stop - # start + # reload + stop + start end end end