I'm facing few problem with GOD
my configuration script look like this
DIRECTORY = "/Users/joshianiket22/myProject/god_script"
> God.pid_file_directory = DIRECTORY
> God.watch do |w|
> w.name = "mess"
> w.start = "ruby /Users/joshianiket22/myProject/god_script/simple.rb"
> w.pid_file = File.join(DIRECTORY,'simple.pid')
> puts File.join(DIRECTORY,'simple.pid')
> w.stop = "ruby -e 'puts \"#{DateTime.now}\"'"
> w.log = File.join(DIRECTORY,'god.log')
> w.behavior(:clean_pid_file)
> w.interval = 10.seconds
> w.start_if do |start|
> start.condition(:process_running) do |c|
> puts "Inside start condition"
> c.interval = 5.seconds
> c.running = false
> end
> end
> end
PROBLEM 1 : GOD PID FILE DILEMMA
In GOD documentation it mention
<https://lh5.googleusercontent.com/-CrxErvCN4To/Uh3LL_9AMJI/AAAAAAAABAM/Dn9iOf9Xmtg/s1600/download+%282%29.png>
Now I have clear set the pid_file and pid_file_directory yet the PID is no
where to be seen in that directory
PROBLEM 2: START_IF CONDITION
<https://lh4.googleusercontent.com/-6on7zN1uo7U/Uh3L7CJqkVI/AAAAAAAABAc/UYK-ucBiU78/s1600/start_if.png>
Now That how one define a start_if condition now I not able to understand
the use case for this condition what conditions is process_running a
condition if yes what are other set of
condition for start_if also what does the attributes inside the do block
suppose to do and when would they be executed
More precisely I referring to
*c.running = false* ( what it does internal and what other list of
attributes are available )
PROBLEM 3 (start/stop/restart command)
Now given my configuration file which has a start command written in it is
required to also write a stop and restart command
so that when done this
sudo god stop mess
> sudo god restart mess
they would get executed and let assume I dont write them what would happen
if run them will GOD will eventually Kill the running process when stop
command is executed
and restart the running process when restart command is executed
Can anyone share light on it
PROBLEM 4 (Whether or whether not to daemonize the process):
According to GOD documentation
<https://lh4.googleusercontent.com/-5Qwctr-prkY/Uh3NkatN82I/AAAAAAAABAo/OTlDq_f5L3E/s1600/download+%283%29.png>
Now Consider I but explicitly put by process to background inside GOD
something like
w.start = "ruby /Users/joshianiket22/myProject/god_script/simple.rb &"
what would happen in such will GOD monitor them for stop and restart
command
So daemonizing your process inside GOD (in start command ) can be consider
a valid approach assuming that GOD know that the process has gone in
background
and it react to all command start / stop / restart on that process when run
against GOD
like
sudo god stop mess
> sudo god restart mess
Can anyone put some light on this as well
--
You received this message because you are subscribed to the Google Groups
"god.rb" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/god-rb.
For more options, visit https://groups.google.com/groups/opt_out.