由于 unicorn_rails 抱怨不同的 gem 版本,我们转而在我们的 bluepill 文件中运行 bundle exec unicorn_rails...。此更改解决了该特定问题并且事情开始和停止但是当我们尝试 sudo bluepill status 我们现在得到
独角兽(像素:XXXXXX):未监控
看起来 bluepill 现在没有监控独角兽进程。如果我停止子进程但不会重新启动父进程,它将重新启动子进程。
我四处搜索,但找不到太多关于这个问题的信息,希望有人能对此有所了解。bluepill 配置文件是
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