Showing posts with label god rubygem unicorn. Show all posts
Showing posts with label god rubygem unicorn. Show all posts

Friday, July 13, 2012

GOD ruby gem for unicorn bundle exec configuration file example.


God.watch do |w|
  w.name = 'unicorn'
  w.interval = 30.seconds
  w.start = "cd #{rails_root} && bundle exec unicorn -c /home/system/deploy/akeyu/config/unicorn.rb -D"
  w.stop = "kill -QUIT `cat #{rails_root}/tmp/pids/unicorn.pid`"
  w.restart = "kill -USR2 `cat #{rails_root}/tmp/pids/unicorn.pid`"
  w.start_grace = 10.seconds
  w.restart_grace = 10.seconds
  w.pid_file = "#{rails_root}/tmp/pids/unicorn.pid"
  w.behavior(:clean_pid_file)
  w.start_if do |start|
    start.condition(:process_running) do |c|
      c.interval = 5.seconds
      c.running = false
    end
  end
end