3

Is it possible to monitor jruby program using God ruby gem ? Any working example will be helpful. Here is what I've tried so far but it doesn't work.

Here is the God file start_app.god

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

Here is the logs when I run 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'

Notice the statement simple moved 'start' to 'up' keeps on repeating itself meaning god couldn't start the my_jruby.rb script.

Anyone who knows the cause of this issue? If can't accomplish this using God, what are the possible alternatives?

Sam Samson
  • 927
  • 4
  • 20
  • 35

0 Answers0