Skip to content

Instantly share code, notes, and snippets.

@xwmx
Created December 4, 2009 20:04
Show Gist options
  • Save xwmx/249312 to your computer and use it in GitHub Desktop.
Save xwmx/249312 to your computer and use it in GitHub Desktop.
God.watch do |w|
w.name = "apache2"
w.interval = 30.seconds # default
w.start = "apache2ctl start"
w.stop = "apache2ctl stop"
w.restart = "apache2ctl restart"
w.start_grace = 10.seconds
w.restart_grace = 10.seconds
w.pid_file = "/var/run/apache2.pid"
w.behavior(:clean_pid_file)
w.start_if do |start|
start.condition(:process_running) do |c|
c.interval = 5.seconds
c.running = false
c.notify = 'admin'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment