我正在尝试用上帝监视一个tweetstream守护进程..我的上帝配置非常简单:
path = File.expand_path(File.dirname(__FILE__))
God.watch do |w|
w.name = "tweet.rb"
w.start = "bundle exec ruby #{path}/tweet.rb start"
w.keepalive
end
虽然我的tweetstream守护程序也是一个标准的实现..当我启动上帝进程时,它似乎循环开始一遍又一遍的过程......我不确定它是否无法启动,或者如果它开始然后关闭..或者我想我不知道如何解释这个...任何帮助表示赞赏:一些示例输出:
I [2012-01-22 23:43:53] INFO: tweet.rb moved 'up' to 'start'
I [2012-01-22 23:43:53] INFO: tweet.rb [trigger] process is running (ProcessRunning)
I [2012-01-22 23:43:53] INFO: tweet.rb move 'start' to 'up'
I [2012-01-22 23:43:53] INFO: tweet.rb registered 'proc_exit' event for pid 74646
I [2012-01-22 23:43:53] INFO: tweet.rb moved 'start' to 'up'
I [2012-01-22 23:43:54] INFO: tweet.rb [trigger] process 74646 exited (ProcessExits)
I [2012-01-22 23:43:54] INFO: tweet.rb move 'up' to 'start'
I [2012-01-22 23:43:54] INFO: tweet.rb deregistered 'proc_exit' event for pid 74646
I [2012-01-22 23:43:54] INFO: tweet.rb start: bundle exec rub /Users/Kevin/Documents/Code/Rails/work/TalkSumo/script/tweet.rb start
I [2012-01-22 23:43:54] INFO: tweet.rb moved 'up' to 'start'
I [2012-01-22 23:43:54] INFO: tweet.rb [trigger] process is running (ProcessRunning)
I [2012-01-22 23:43:54] INFO: tweet.rb move 'start' to 'up'
I [2012-01-22 23:43:54] INFO: tweet.rb registered 'proc_exit' event for pid 74648
I [2012-01-22 23:43:54] INFO: tweet.rb moved 'start' to 'up'
I [2012-01-22 23:43:54] INFO: tweet.rb [trigger] process 74648 exited (ProcessExits)
I [2012-01-22 23:43:54] INFO: tweet.rb move 'up' to 'start'
I [2012-01-22 23:43:54] INFO: tweet.rb deregistered 'proc_exit' event for pid 74648
I [2012-01-22 23:43:54] INFO: tweet.rb start: bundle exec ruby /Users/Kevin/Documents/Code/Rails/work/TalkSumo/script/tweet.rb star
如果我删除bundle exec并只使用:
w.start = "ruby #{path}/tweet.rb start"
错误日志更改为:
I [2012-01-23 10:41:25] INFO: tweet.rb [ok] process is not running (ProcessRunning)
I [2012-01-23 10:41:30] INFO: tweet.rb [ok] process is not running (ProcessRunning)
I [2012-01-23 10:41:35] INFO: tweet.rb [ok] process is not running (ProcessRunning)
I [2012-01-23 10:41:40] INFO: tweet.rb [ok] process is not running (ProcessRunning)
I [2012-01-23 10:41:45] INFO: tweet.rb [ok] process is not running (ProcessRunning)