Permalink
Browse files

[#3463729] monitoring w/ god.

  • Loading branch information...
1 parent 12318a1 commit 4a5df0853ce552ab4cf355f08ab4db12c3632afc @kakutani kakutani committed May 10, 2010
Showing with 44 additions and 8 deletions.
  1. +2 −0 Gemfile
  2. +14 −8 Gemfile.lock
  3. +12 −0 config/deploy.rb
  4. +16 −0 config/rubykaigi.god
View
2 Gemfile
@@ -19,6 +19,8 @@ gem 'rails_warden'
gem 'warden_oauth'
gem 'warden-openid'
+gem 'god'
+
group :development do
gem 'capistrano', :require => nil
gem 'capistrano-ext', :require => nil
View
22 Gemfile.lock
@@ -25,7 +25,7 @@ dependencies:
version: = 2.3.5
require: []
- mysql:
+ haml:
group:
- :default
version: ">= 0"
@@ -35,7 +35,7 @@ dependencies:
version: ">= 0"
require:
- smtp-tls
- haml:
+ mysql:
group:
- :default
version: ">= 0"
@@ -46,19 +46,19 @@ dependencies:
version: ">= 0"
require:
- machinist/active_record
- rails_warden:
+ i18n_generators:
group:
- :default
version: ">= 0"
- i18n_generators:
+ rails_warden:
group:
- :default
version: ">= 0"
- delayed_job:
+ whenever:
group:
- :default
version: ">= 0"
- whenever:
+ delayed_job:
group:
- :default
version: ">= 0"
@@ -87,14 +87,18 @@ dependencies:
version: ">= 0"
require: []
- warden-openid:
+ god:
group:
- :default
version: ">= 0"
configatron:
group:
- :default
version: ">= 0"
+ warden-openid:
+ group:
+ - :default
+ version: ">= 0"
webrat:
group:
- :test
@@ -262,6 +266,8 @@ specs:
version: 1.5.3
- gettext:
version: 1.93.0
+- god:
+ version: 0.8.0
- haml:
version: 2.2.24
- hoptoad_notifier:
@@ -309,7 +315,7 @@ specs:
version: 0.7.1
- whenever:
version: 0.4.2
-hash: 92771a0047a3be3696ee9920bc6e75bb2a468cad
+hash: d9713eaaae472d3bed25d675472e3a1ecaedc8fd
sources:
- Git:
uri: git://github.com/amatsuda/i18n_generators.git
View
12 config/deploy.rb
@@ -76,6 +76,18 @@ def setup_shared_config(path)
end
end
+namespace :god do
+ task :start do
+ pid_path = "#{current_path}/tmp/pids/god.pid"
+ log_path = "#{current_path}/log/god.log"
+ config_path = "#{current_path}/config/rubykaigi.god"
+ run("god -c #{config_path} -P #{pid_path} -l #{log_path}")
+ end
+
+ task
+end
+
+
Dir[File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
$: << File.join(vendored_notifier, 'lib')
end
View
16 config/rubykaigi.god
@@ -0,0 +1,16 @@
+RAILS_ROOT="/home/rubykaigi/railsapp/current"
+
+God.watch do |w|
+ w.name = "delayed_job"
+ w.pid_file = "#{RAILS_ROOT}/tmp/pids/delayed_job.pid"
+ w.start = "cd #{RAILS_ROOT}; RAILS_ENV=production script/delayed_job start"
+ w.restart = "cd #{RAILS_ROOT}; RAILS_ENV=production script/delayed_job restart"
+ w.stop = "cd #{RAILS_ROOT}; RAILS_ENV=production script/delayed_job stop"
+ w.behavior(:clean_pid_file)
+ w.start_if do |start|
+ start.condition(:process_running) do |c|
+ c.running = false
+ c.interval = 5.seconds
+ end
+ end
+end

0 comments on commit 4a5df08

Please sign in to comment.