Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Home

geoffgarside edited this page · 7 revisions
Clone this wiki locally

Example god config using the Angel gem.



require 'rubygems'
require 'angel'

[4000, 4001, 4002].each do |server_port|

  1. If you need a prefix then add the key here
  2. If overriding pid or log file, prefix with
  3. the #{current_path}
    server_options = {
    :user => “geoffgarside”,
    :group => “geoffgarside”,
    :cwd => “/usr/home/geoffgarside/apps/my_app/current”,
    :environment => “production” }
God.watch do |w| w.name = “my_app-servers-#{server_port}” w.group = “my_app-servers” w.stop = Angel.stop(:mongrel, server_options, :port => “#{server_port}”) w.start = Angel.start(:mongrel, server_options, :port => “#{server_port}”) w.restart = Angel.restart(:mongrel, server_options, :port => “#{server_port}”) w.interval = 30.seconds w.start_grace = 10.seconds w.restart_grace = 10.seconds w.pid_file = Angel.pid_file(server_options, :port => “#{server_port}”) w.uid = “geoffgarside” w.gid = “geoffgarside” Angel.setup(w) end

end


This would most likely be generated by capistrano and kept in config/god.conf. Your god startup would then load in all /usr/home//apps//current/god.conf files.
Something went wrong with that request. Please try again.