Created
August 6, 2008 18:48
-
-
Save r38y/4253 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RAILS_ROOT = '/var/www/apps/fetcher/production/current' | |
FETCHER_SCRIPT = "#{RAILS_ROOT}/script/email_fetcher" | |
God.watch do |w| | |
w.name = "fetcher-daemon" | |
w.uid = 'deploy' | |
w.gid = 'users' | |
w.interval = 30.seconds | |
w.start = "RAILS_ENV=production #{FETCHER_SCRIPT} start &" | |
w.stop = "RAILS_ENV=production #{FETCHER_SCRIPT} stop &" | |
w.restart = "RAILS_ENV=production #{FETCHER_SCRIPT} restart &" | |
w.grace = 10.seconds | |
w.pid_file = File.join(RAILS_ROOT, 'log', 'EmailFetcherDaemon.pid') | |
w.behavior(:clean_pid_file) | |
w.start_if do |start| | |
start.condition(:process_running) do |c| | |
c.interval = 5.seconds | |
c.running = false | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment