I am trying to monitor java process that is already running.
Following is my god configuration(test.god):
God.watch do |w|
w.name = "Test"
w.start = "java Test"
w.keepalive
I started god monitoring with following command:
god -c test.god
Following is log:
INFO: Loading test.god
INFO: Syslog enabled.
INFO: Using pid file directory: /home/guest/.god/pids
INFO: Started on drbunix:///tmp/god.17165.sock
INFO: Test move 'unmonitored' to 'up'
INFO: Test moved 'unmonitored' to 'up'
INFO: Test [trigger] process is not running (ProcessRunning)
INFO: Test move 'up' to 'start'
INFO: Test start: java Test
INFO: Test moved 'up' to 'up'
As I mentioned, I already started Test.java class and its up and running & when I started monitoring with god its unable to identifiy Test.java as running and its Test.java again.
So there are 2 processes running with name Test, one is started by me and other is started by god.
Any one please suggest me how to create god configuration to start processes that are not running. I may case since Test.java is already running when I started monitoring with god it shouldn't start it again. Only when Test.java get's killed/stopped god should start it.
Well perhaps you have to give it a pid to monitor you need specify the pid_file to god
Straight from the GOD rb documentation
I'll also recommend you read my answer over here
if you read thoroughly both question and answer(especially when I describle
c.running assign as false or true
meaning in the answer) you may the exact answer you are looking forHope this help