3

是否可以使用God ruby​​ gem 监控 jruby 程序?任何工作示例都会有所帮助。这是我到目前为止尝试过的,但它不起作用。

这是上帝文件start_app.god

God.watch do |w|
  w.name = "simple"
  w.start = "jruby /path/to/my_jruby/my_jruby.rb"
  w.keepalive
end

这是我跑步时的日志god -c start_app.god -D

I [2013-09-13 17:22:38]  INFO: Loading /path/to/start_app/start_app.god
I [2013-09-13 17:22:38]  INFO: Syslog enabled.
I [2013-09-13 17:22:38]  INFO: Using pid file directory: /var/run/god
I [2013-09-13 17:22:38]  INFO: Started on drbunix:///tmp/god.17165.sock
I [2013-09-13 17:22:38]  INFO: simple move 'unmonitored' to 'init'
I [2013-09-13 17:22:38]  INFO: simple moved 'unmonitored' to 'init'
I [2013-09-13 17:22:38]  INFO: simple [trigger] process is not running (ProcessRunning)
I [2013-09-13 17:22:38]  INFO: simple move 'init' to 'start'
I [2013-09-13 17:22:38]  INFO: simple start: jruby /path/to/my_jruby/my_jruby.rb
I [2013-09-13 17:22:39]  INFO: simple moved 'init' to 'start'
I [2013-09-13 17:22:39]  INFO: simple move 'start' to 'up'
I [2013-09-13 17:22:39]  INFO: simple registered 'proc_exit' event for pid 16727
I [2013-09-13 17:22:39]  INFO: simple moved 'start' to 'up'
I [2013-09-13 17:22:42]  INFO: simple [trigger] process 16727 exited {:pid=>16727, :exit_code=>256, :exit_signal=>17, :thread_group_id=>16727} (ProcessExits)
I [2013-09-13 17:22:42]  INFO: simple move 'up' to 'start'
I [2013-09-13 17:22:42]  INFO: simple deregistered 'proc_exit' event for pid 16727
I [2013-09-13 17:22:42]  INFO: simple start: jruby /path/to/my_jruby/my_jruby.rb
I [2013-09-13 17:22:42]  INFO: simple moved 'up' to 'start'
I [2013-09-13 17:22:42]  INFO: simple move 'start' to 'up'
I [2013-09-13 17:22:42]  INFO: simple registered 'proc_exit' event for pid 16753
I [2013-09-13 17:22:42]  INFO: simple moved 'start' to 'up'

请注意,该语句simple moved 'start' to 'up'不断重复,这意味着上帝无法启动 my_jruby.rb 脚本。

有谁知道这个问题的原因?如果不能使用上帝来实现这一点,那么可能的替代方案是什么?

4

0 回答 0