God.watch do |w|w.name = "myapp-unicorn"w.group = "myapp"w.dir = RAILS_ROOTw.env = { 'RAILS_ENV' => environment }w.start = "bundle exec unicorn -c config/unicorn.rb -E #{environment} -D"w.stop = "kill -s QUIT `cat #{PID_FILE}`"w.restart = "kill -s USR2 `cat #{PID_FILE}`"w.pid_file = PID_FILEw.behavior :clean_pid_filew.interval = 30.secondsw.start_if do |start|start.condition(:process_running) do |c|c.interval = 15.secondsc.running = false#c.notify = 'developers'endendw.restart_if do |restart|restart.condition(:memory_usage) do |c|c.above = 150.megabytesc.times = [3, 5] # 3 out of 5 intervals#c.notify = 'developers'endrestart.condition(:cpu_usage) do |c|c.above = 50.percentc.times = 5#c.notify = 'developers'endendw.lifecycle do |on|on.condition(:flapping) do |c|c.to_state = [:start, :restart]c.times = 5c.within = 5.minutec.transition = :unmonitoredc.retry_in = 10.minutesc.retry_times = 5c.retry_within = 2.hours#c.notify = 'developers'endendend
$ RAILS_ENV=staging bundle exec god -c config/god.rb -DI [2013-05-07 12:16:19] INFO: Loading config/god.rbI [2013-05-07 12:16:19] INFO: Syslog enabled.I [2013-05-07 12:16:19] INFO: Using pid file directory: /home/myapp/.god/pidsI [2013-05-07 12:16:19] INFO: Started on drbunix:///tmp/god.17165.sockI [2013-05-07 12:16:19] INFO: myapp-unicorn move 'unmonitored' to 'up'I [2013-05-07 12:16:19] INFO: myapp-unicorn moved 'unmonitored' to 'up'I [2013-05-07 12:16:19] INFO: myapp-unicorn [trigger] process is not running (ProcessRunning)I [2013-05-07 12:16:19] INFO: myapp-unicorn move 'up' to 'start'I [2013-05-07 12:16:19] INFO: myapp-unicorn before_start: no pid file to delete (CleanPidFile)I [2013-05-07 12:16:19] INFO: myapp-unicorn start: budle exec unicorn -c config/unicorn.rb -E staging -DW [2013-05-07 12:16:19] WARN: myapp-unicorn start command exited with non-zero code = 1I [2013-05-07 12:16:19] INFO: myapp-unicorn moved 'up' to 'up'I [2013-05-07 12:16:19] INFO: myapp-unicorn [trigger] process is not running (ProcessRunning)I [2013-05-07 12:16:19] INFO: myapp-unicorn move 'up' to 'start'I [2013-05-07 12:16:19] INFO: myapp-unicorn before_start: no pid file to delete (CleanPidFile)I [2013-05-07 12:16:19] INFO: myapp-unicorn start: budle exec unicorn -c config/unicorn.rb -E staging -DW [2013-05-07 12:16:19] WARN: myapp-unicorn start command exited with non-zero code = 1I [2013-05-07 12:16:19] INFO: myapp-unicorn moved 'up' to 'up'
...
--
You received this message because you are subscribed to the Google Groups "god.rb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to god-rb+un...@googlegroups.com.
To post to this group, send email to god...@googlegroups.com.
Visit this group at http://groups.google.com/group/god-rb?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.