Skip to content

Instantly share code, notes, and snippets.

@willnet
Created June 11, 2013 08:27
Show Gist options
  • Save willnet/5755284 to your computer and use it in GitHub Desktop.
Save willnet/5755284 to your computer and use it in GitHub Desktop.
god setting example
RAILS_ROOT = "/path/to/root"
God.watch do |w|
w.name = "solr"
w.interval = 30.seconds # default
w.dir = RAILS_ROOT
w.log = "#{RAILS_ROOT}/log/god.log"
w.env = { 'RAILS_ROOT' => RAILS_ROOT,
'RAILS_ENV' => "production",
'HOME' => '/root'}
w.start = "#{RAILS_ROOT}/bin/rake -f #{RAILS_ROOT}/Rakefile sunspot:solr:start --trace"
w.stop = "#{RAILS_ROOT}/bin/rake -f #{RAILS_ROOT}/Rakefile sunspot:solr:stop"
w.start_grace = 10.seconds
w.restart_grace = 10.seconds
w.pid_file = File.join(RAILS_ROOT, "solr/pids/production/sunspot-solr-production.pid")
w.behavior(:clean_pid_file)
w.start_if do |start|
start.condition(:process_running) do |c|
c.running = false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment