Trying to get a simple God demo working.
In an empty directory I created the following files as per the God documentation:
simple.rb:
loop do
puts 'Hello'
sleep 1
end
simple.rb:
God.watch do |w|
w.name = "simple"
w.start = "ruby simple.rb"
w.log = 'myprocess.log'
w.keepalive
end
Then I run:
$ sudo god -c simple.god -D
and get this output:
I [2018-10-31 23:19:39] INFO: Loading simple.god
I [2018-10-31 23:19:39] INFO: Syslog enabled.
I [2018-10-31 23:19:39] INFO: Using pid file directory: /var/run/god
I [2018-10-31 23:19:39] INFO: Started on drbunix:///tmp/god.17165.sock
I [2018-10-31 23:19:39] INFO: simple move 'unmonitored' to 'init'
I [2018-10-31 23:19:39] INFO: simple moved 'unmonitored' to 'init'
I [2018-10-31 23:19:39] INFO: simple [trigger] process is running (ProcessRunning)
I [2018-10-31 23:19:39] INFO: simple move 'init' to 'up'
I [2018-10-31 23:19:39] INFO: simple registered 'proc_exit' event for pid 11741
I [2018-10-31 23:19:39] INFO: simple moved 'init' to 'up'
but I can't seem to capture the actual output from the watched process. The 'myprocess.log' file never gets created or written to.
But beyond that I'm just experiencing some really weird behavior. Like sometimes when I run it it spews an endless stream of output showing processes starting and exiting one after another. Sometimes it logs to files after I've renamed them. I can't get a peg on why it's behaving so erratically.
God 0.13.7 / ruby 2.3.0 / OSX 10.13.6