Created
October 6, 2008 19:45
-
-
Save azisaka/15115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
God.watch do |w| | |
w.name = "apache" | |
w.start = "apache2ctl -k start" | |
w.stop = "apache2ctl -k stop" | |
w.restart = "apache2ctl -k restart" | |
w.start_if do |start| | |
start.condition(:process_running) do |c| | |
c.interval = 10.seconds | |
c.running = false | |
end | |
end | |
w.restart_if do |restart| | |
restart.condition(:cpu_usage) do |c| | |
c.above = 20.percent | |
c.interval = 1.seconds | |
c.times = 5 | |
end | |
restart.condition(:memory_usage) do |c| | |
c.above = 512.megabytes | |
c.interval = 1.seconds | |
c.times = 5 | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3.times do | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment