On Sep 14, 1:06 pm, None <[EMAIL PROTECTED]> wrote:
> I've found and fixed my problem(s).  Turns out the let-god-demonize
> thing was a red herring.  The fixes were to use the PortablePoller on
> CENTOS, and to modify God::System::Process#spawn not to perform chroot
> and chdir.  Voila!

I don't suppose anyone can explain a bit better on how to achieve
this? I'm experiencing the same problems outlined here on CENTOS also.
Kill the processes manually after loading god and it doesn't even see
the fact they died, nor do I see it polling in the logs, it just sits
there apparently doing nothing.

#######################
def make_fail_safe(watcher)
  watcher.lifecycle do |on|
    on.condition(:flapping) do |c|
      c.to_state     = [:start, :restart]
      c.times        = 5
      c.within       = 5.minutes
      c.transition   = :unmonitored
      c.retry_in     = 10.minutes
      c.retry_times  = 5
      c.retry_within = 2.hours
    end
  end
end

God.watch do |w|
  w.name     = 'apache'
  w.pid_file = '/var/run/httpd.pid'
  w.interval = 60.seconds

  w.start   = '/etc/init.d/httpd start'
  w.stop    = '/etc/init.d/httpd stop'
  w.restart = '/etc/init.d/httpd graceful'

  w.start_grace   = 20.seconds
  w.restart_grace = 20.seconds

  w.behavior(:clean_pid_file)

  w.restart_if do |r|
    r.condition(:cpu_usage)   {|c| c.notify = 'developers'; c.above =
80.percent;    c.times = 5}
    r.condition(:cpu_usage)   {|c| c.notify = 'developers'; c.above =
60.percent;    c.times = 2}
    r.condition(:memory_usage){|c| c.notify = 'developers'; c.above =
500.megabytes; c.times = 5}
    r.condition(:http_response_code) do |c|
      c.notify      = 'developers'
      c.host        = 'www.example.com'
      c.path        = '/god'
      c.code_is_not = 200
      c.timeout     = 2.seconds
    end
  end

  make_fail_safe(w)
end

God.contact(:email) do |c|
  c.name  = 'Me'
  c.email = '[EMAIL PROTECTED]'
  c.group = 'developers'
end
#######################


regards,
Danial
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"god.rb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/god-rb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to