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