Hello,
I'm dealing with non-daemon watches and I've noticed that stopping a
freshly-started process is delayed by half a minute or so (a watch
that has been running for a minute or more is stopped immediately, but
it didn't occure to me while I was testing it initially).
Steps to reproduce: set a non-daemon watch on this script:
#!/usr/bin/env ruby
$running = true
STDOUT.sync = true
puts "Hello ruby"
Signal.trap("TERM") do
$running = false
end
while($running) do
sleep 1
end
puts "Exiting"
like so:
God.pid_file_directory = "#{RAILS_ROOT}/log"
God.watch do |w|
w.name = "test"
w.interval = 60.seconds
w.start = "#{RAILS_ROOT}/test.rb"
w.log = "#{RAILS_ROOT}/log/test.log"
end
then load it into god, execute
god start test
god stop test
there will be a half a minute delay before "Exiting" message appears
in test.log
This behavior is not an issue to me, since it seems that it works fine
after the start up, but it got me confused while I was testing start/
stop/restart initially.
On a side note, don't you think it might be a good default to have
STDOUT.sync = true set for the spawned script, or maybe give a watch
option for that behavior?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---