public
Description: I eat URLs. RAWRRRRR!
Clone URL: git://github.com/bottlecaplabs/zombieurl.git
Search Repo:
adding the .god config file (and ignoring the email.god)
Greg Borenstein (author)
Fri Apr 18 17:03:10 -0700 2008
commit  3c975f25d4576e6f4cfa5c8bebaa8872192f9467
tree    24dd3e4309fa8ed978de1c7edc858d912aff0978
parent  cf3394dcaff044a3ed80d7ef4a3f87e11549437d
...
 
1
2
3
...
1
2
3
4
0
@@ -1,3 +1,4 @@
0
+email.god
0
 log/*.log
0
 log/*.pid
0
 tmp/**/*
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
0
@@ -1 +1,61 @@
0
+begin
0
+ require '/etc/email.god'
0
+rescue LoadError
0
+end
0
+
0
+RAILS_ROOT = "/var/www/apps/zombieurl"
0
+
0
+# mongrel_rails start -c /var/www/apps/zombieurl -e production -p 3000 -P /var/www/apps/zombieurl/log/mongrel.3000.pid -d
0
+
0
+%w{3000 3001 3002}.each do |port|
0
+ God.watch do |w|
0
+ w.name = "zombieurl-mongrel-#{port}"
0
+ w.group = 'mongrels'
0
+ w.interval = 30.seconds # default
0
+ w.start = "mongrel_rails start -c #{RAILS_ROOT} -e production -p #{port} \
0
+ -P #{RAILS_ROOT}/log/mongrel.#{port}.pid -d"
0
+ w.stop = "mongrel_rails stop -P #{RAILS_ROOT}/log/mongrel.#{port}.pid"
0
+ w.restart = "mongrel_rails restart -P #{RAILS_ROOT}/log/mongrel.#{port}.pid"
0
+ w.start_grace = 20.seconds
0
+ w.restart_grace = 20.seconds
0
+ w.pid_file = File.join(RAILS_ROOT, "log/mongrel.#{port}.pid")
0
+
0
+ w.behavior(:clean_pid_file)
0
+
0
+ w.start_if do |start|
0
+ start.condition(:process_running) do |c|
0
+ c.running = false
0
+ # c.notify = 'jchris'
0
+ end
0
+ end
0
+
0
+ w.restart_if do |restart|
0
+ restart.condition(:memory_usage) do |c|
0
+ c.above = 150.megabytes
0
+ c.times = [3, 5] # 3 out of 5 intervals
0
+ # c.notify = 'jchris'
0
+ end
0
+
0
+ restart.condition(:cpu_usage) do |c|
0
+ c.above = 50.percent
0
+ c.times = 5
0
+ # c.notify = 'jchris'
0
+ end
0
+ end
0
+
0
+ # lifecycle
0
+ w.lifecycle do |on|
0
+ on.condition(:flapping) do |c|
0
+ c.to_state = [:start, :restart]
0
+ c.times = 5
0
+ c.within = 5.minute
0
+ c.transition = :unmonitored
0
+ c.retry_in = 10.minutes
0
+ c.retry_times = 5
0
+ c.retry_within = 2.hours
0
+ # c.notify = 'jchris'
0
+ end
0
+ end
0
+ end
0
+end

Comments

    No one has commented yet.