Created
January 29, 2013 10:33
-
-
Save tachiba/4663353 to your computer and use it in GitHub Desktop.
god > gitlab.rb
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
app_root = "/home/gitlab/gitlabhq" | |
God.watch do |w| | |
w.name = "gitlab" | |
w.interval = 30.seconds | |
w.start_grace = 10.seconds | |
w.restart_grace = 10.seconds | |
w.dir = app_root | |
w.env = { | |
'BUNDLE_GEMFILE' => "#{app_root}/Gemfile" | |
} | |
# unicorn needs to be run from the rails root | |
w.start = "bundle exec unicorn_rails -c #{app_root}/config/unicorn.rb -E production -D" | |
# QUIT gracefully shuts down workers | |
w.stop = "kill -QUIT `cat #{app_root}/tmp/pids/unicorn.pid`" | |
# USR2 causes the master to re-create itself and spawn a new worker pool | |
w.restart = "kill -USR2 `cat #{app_root}/tmp/pids/unicorn.pid`" | |
w.pid_file = "#{app_root}/tmp/pids/unicorn.pid" | |
w.log = "#{app_root}/log/unicorn.log" | |
w.uid = 'gitlab' | |
w.gid = 'git' | |
w.behavior(:clean_pid_file) | |
w.start_if do |start| | |
start.condition(:process_running) do |c| | |
c.interval = 10.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