Control package exec unicorn_rails with bluepill

Thanks to unicorn_rails complaining about different versions of gem, we moved on to running the unicorn_rails package ... in our bluepill files. This change decided that a particular problem and everything started and stopped, but when we try sudo bluepill status, we now get

unicorn (pix: XXXXXX): not controlled

Bluepill now seems to no longer control unicorn processes. It will restart the child processes if I stopped them, but did not restart the parent process.

I searched around, but cannot find much about this problem and was hoping that someone could shed light on it. Bluepill configuration file -

app_dir = "/opt/local/share/httpd/apps/xyz"
Bluepill.application('xyz', :log_file => "#{app_dir}/current/log/bluepill.log") do |app|
  app.process('unicorn') do |process|
    process.pid_file    = "#{app_dir}/shared/pids/unicorn.pid"
    process.working_dir = "#{app_dir}/current"

    process.stdout = process.stderr = "#{app_dir}/shared/log/unicorn.err.log"
    process.start_command = "bundle exec unicorn_rails -D -c #{app_dir}/current/config/environments/production/unicorn.rb -E production"
    process.stop_command = "kill -QUIT {{PID}}"
    process.restart_command = "kill -USR2 {{PID}}"

    process.start_grace_time = 8.seconds
    process.stop_grace_time = 5.seconds
    process.restart_grace_time = 13.seconds

    process.monitor_children do |child_process|
      child_process.stop_command = "kill -QUIT {{PID}}"

      child_process.checks :mem_usage, :every => 10.seconds, :below => 200.megabytes, :times => [3,5]
      child_process.checks :cpu_usage, :every => 10.seconds, :below => 50, :times => [3,5]
    end
  end

end
+5
source share
2 answers

bundle exec unicorn_rails. Bluepill bundle exec , .

bluepill, unicorn_rails :

Bluepill.application('xyz') do |app|
  app.environment = `env -i BUNDLE_GEMFILE=#{app_dir}/Gemfile bundle exec env`.lines.inject({}) do |env_hash,l|
    kv = l.chomp.split('=',2)
    env_hash[kv[0] = kv[1]
    env_hash
  end

  app.process('unicorn') do |process|
    process.start_command = "unicorn_rails -D -c #{app_dir}/current/config/environments/production/unicorn.rb -E production"
  end
end

(. . , app.environment bundle exec .)

bluepill, , app.environment.

+3

, , . , , "bluepill quit", , , bluepill "".

@blt04 . . 8 , preload_app true ... (Rails) 12 , 8.

30 ( , ) . Bluepill "" 30 , . .

, , Rails.

+3

All Articles