I am trying out god and I have set up the god file below. I am getting
the error in the subject of this email which makes no sense because
obviously the directory is writable by root.

Here is the god script.

#run with: god -c /home/momentum/app/current/lib/worker/daemons/
momentum.god -D

RAILS_ROOT = "/home/momentum/app/current"
puts RAILS_ROOT
DAEMONS_ROOT = "#{RAILS_ROOT}/lib/worker/daemons"
RUBY = "/opt/ruby-enterprise/bin/ruby"

%w{keyword_feeder url_feeder twitter_worker url_worker}.each do |app|


  app_file_name = "#{DAEMONS_ROOT}/#{app}.rb"
  puts app_file_name
  app_pid_file = "/var/run/#{app}.rb.pid"
  puts app_pid_file
  God.watch do |w|
    #this is so you can stop all of them at once
    w.group= 'momentum_daemons'
    w.name = app
    w.start = "#{RUBY} #{app_file_name}"
   puts w.start
    #need a better way to deal with this
    w.stop = "kill -9 `cat #{app_pid_file}`;rm -f #{app_pid_file}"
    w.pid_file = app_pid_file
    #this redirects the stdout

    w.log = "#{RAILS_ROOT}/log/#{app}.log"
  end
end

-- 
You received this message because you are subscribed to the Google Groups 
"god.rb" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/god-rb?hl=en.

Reply via email to