Skip to content

Instantly share code, notes, and snippets.

@tachiba
Created January 29, 2013 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tachiba/4663353 to your computer and use it in GitHub Desktop.
Save tachiba/4663353 to your computer and use it in GitHub Desktop.
god > gitlab.rb
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