使用神宝石监控JRuby进程

时间:2013-09-13 14:36:50

标签: ruby jruby god process-monitoring process-monitor

是否可以使用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脚本。

有谁知道这个问题的原因?如果无法使用God完成此操作,可能的替代方案是什么?

0 个答案:

没有答案