After getting god working successfully to monitor one process, i've
decided to try god on another...
unfortunately getting god to watch an ssh tunnel doesn't work. god
seems to be recording a /var/run/god/ssh.pid that is consistently 2
smaller than the process actually launched.
example /var/run/god/ssh.pid = 3224
when the process as seen with 'ps' is 3226
The consequence is that god keeps starting what it has already
started.
God.watch do |w|
w.uid = 'xman'
w.gid = 'xman'
w.log = "/home/xman/code/test/god.log"
# not sure what w.dir should be here. where the ssh.god config
resides? /usr/bin where ssh resides? /home/xman? does it matter?
w.dir = "/home/xman/code/test"
w.name = "ssh"
w.interval = 10.seconds # default
w.start = "/usr/bin/ssh -f -L 3307:127.0.0.1:3306
[email protected] -N"
w.start_grace = 60.seconds
w.restart_grace = 60.seconds
#w.behavior(:clean_pid_file)
w.start_if do |start|
start.condition(:process_running) do |c|
#c.interval = 5.seconds
c.running = false
end
end
# lifecycle
w.lifecycle do |on|
on.condition(:flapping) do |c|
c.to_state = [:start, :restart]
c.times = 5
c.within = 5.minute
c.transition = :unmonitored
c.retry_in = 3.minutes
c.retry_times = 5
c.retry_within = 2.hours
end
end
end
--
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.