Hi, I am running a backgroundrb server and would like to known, what
is the best way of knowing when the backgroundrb dies?
What I am doing is that my worker run in a big try catch. When the
script failed, the catch is run. So I can clean my stuff, send my
alert email and exit.
For testing purpose, i manually kill backgroundrb to see how my script
react. This working well, but the Exception send by backgroundrb
is :exit.
What should be the error message when backgroundrb is dead?
this is the snippet of code:
rescue Exception => e
log.info "[ERROR] | FATAL ERROR"
log.info "[ERROR] | #{e.message}" # The error I got is: exit
log.info "[ERROR] | #{e.backtrace}"
log.info "[INFO] | Sending failure email..."
SystemMailer
.deliver_failure(summary,"FAILURE","#{File.join(LOG_PATH,name)}")
persistent_job.finish!
end
this is the output in my log file:
Mon Apr 27 10:59:50 -0400 2009 | [ERROR] | FATAL ERROR
Mon Apr 27 10:59:50 -0400 2009 | [ERROR] | exit
Mon Apr 27 10:59:50 -0400 2009 | [ERROR] | /opt/local/lib/ruby/gems/
1.8/gems/packet-0.1.14/bin/../lib/packet/packet_core.rb:210:in `exit'/
opt/local/lib/ruby/gems/1.8/gems/packet-0.1.14/bin/../lib/packet/
packet_core.rb:210:in `shutdown'/opt/local/lib/ruby/gems/1.8/gems/
packet-0.1.14/bin/../lib/packet/packet_core.rb:138:in `start_reactor'/
opt/local/lib/ruby/gems/1.8/gems/activesupport-
etc...
Thanks
p.S. sorry for bad english...
_______________________________________________
Backgroundrb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/backgroundrb-devel