diff --git a/Gemfile b/Gemfile index 1c8f3d417..bd75f3d66 100644 --- a/Gemfile +++ b/Gemfile @@ -40,6 +40,7 @@ gem 'unicorn', '~> 4.1.1' group :production do gem "airbrake", '~> 3.0.5' # gem 'newrelic_rpm', '~> 3.1.1' + gem 'bluepill', :require => false end group :development do @@ -64,7 +65,6 @@ group :development do # gem 'capistrano-exts', :require => false #, :git => 'git://github.com/chipiga/capistrano-exts.git' # gem 'capistrano-recipes', :require => false gem 'capistrano_colors', :require => false - gem 'bluepill', :require => false end group :development, :test do diff --git a/bin/autostart.sh b/bin/autostart.sh index 7877066ac..7848951ad 100755 --- a/bin/autostart.sh +++ b/bin/autostart.sh @@ -2,7 +2,7 @@ for f in `ls /srv` do - sudo -u rosa rvmsudo bundle exec bluepill load /srv/$f/current/config/production.pill APP_NAME=$f + sudo -u rosa bundle exec bluepill --no-privileged load /srv/$f/current/config/production.pill APP_NAME=$f done /srv/rosa_build/current/bin/mount_downloads.sh diff --git a/config/deploy/pingwinsoft.rb b/config/deploy/pingwinsoft.rb index ad87b2146..a15b8c22a 100644 --- a/config/deploy/pingwinsoft.rb +++ b/config/deploy/pingwinsoft.rb @@ -10,6 +10,6 @@ role :db, domain, :primary => true set :application, "rosa_build_#{stage}" set :deploy_to, "/srv/#{application}" -set :unicorn_port, 8081 +# set :unicorn_port, 8081 before "deploy:restart", "deploy:stub_xml_rpc" diff --git a/config/deploy/ui.rb b/config/deploy/ui.rb index 41cae1601..824b9075b 100644 --- a/config/deploy/ui.rb +++ b/config/deploy/ui.rb @@ -10,6 +10,6 @@ role :db, domain, :primary => true set :application, "rosa_build_#{stage}" set :deploy_to, "/srv/#{application}" -set :unicorn_port, 8082 +# set :unicorn_port, 8082 before "deploy:restart", "deploy:stub_xml_rpc" diff --git a/lib/recipes/bluepill.rb b/lib/recipes/bluepill.rb index 43e4c78cf..ed2a8fd20 100644 --- a/lib/recipes/bluepill.rb +++ b/lib/recipes/bluepill.rb @@ -1,21 +1,21 @@ Capistrano::Configuration.instance(:must_exist).load do namespace :bluepill do - set(:bluepill_config) { File.join release_path, 'config', 'production.pill' } + set :bluepill_binary, "bundle exec bluepill --no-privileged" desc "Stop processes that bluepill is monitoring and quit bluepill" task :quit, :roles => [:app] do - sudo "bundle exec bluepill stop APP_NAME=#{fetch :application}" - sudo "bundle exec bluepill quit APP_NAME=#{fetch :application}" + 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 desc "Load bluepill configuration and start it" task :start, :roles => [:app] do - sudo "bundle exec bluepill load #{bluepill_config} APP_NAME=#{fetch :application}" + run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} load config/production.pill APP_NAME=#{fetch :application}" end desc "Prints bluepills monitored processes statuses" task :status, :roles => [:app] do - sudo "bundle exec bluepill status APP_NAME=#{fetch :application}" + run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} status APP_NAME=#{fetch :application}" end end end