似乎無法獲得延遲工作獲得與monit的運行。這裏是我的delayed_job.monitrc文件..延遲工作,monit的
check process delayed_job with pidfile /var/www/app/shared/pids/delayed_job.pid
start program = "cd /var/www/myapp/current && script/delayed_job start RAILS_ENV=production"
as uid deploy and gid www-data
stop program = "cd /var/www/myapp/current && script/delayed_job stop RAILS_ENV=production"
as uid deploy and gid www-data
if mem usage > 20% for 5 cycles then alert
if mem usage > 30% for 5 cycles then restart
我曾嘗試做一個直接的命令以及這將不會沒有monit工作。我必須在腳本中的當前目錄/ delayed_job的開始功能,或者它拋出一個錯誤,如..
/var/www/myapp/current/script/delayed_job start RAILS_ENV=production
/usr/local/lib/ruby/1.8/fileutils.rb:243:in `mkdir': Permission denied - log (Errno::EACCES)
from /usr/local/lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
from /usr/local/lib/ruby/1.8/fileutils.rb:217:in `mkdir_p'
from /usr/local/lib/ruby/1.8/fileutils.rb:215:in `reverse_each'
from /usr/local/lib/ruby/1.8/fileutils.rb:215:in `mkdir_p'
from /usr/local/lib/ruby/1.8/fileutils.rb:201:in `each'
from /usr/local/lib/ruby/1.8/fileutils.rb:201:in `mkdir_p'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/buffered_logger.rb:51:in `initialize'
from /var/www/myapp/releases/20101001032406/config/initializers/dj.rb:4:in `new'
from /var/www/myapp/releases/20101001032406/config/initializers/dj.rb:4
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:147:in `load_without_new_constant_marking'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:147:in `load'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:622:in `load_application_initializers'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:621:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:621:in `load_application_initializers'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:176:in `process'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send'
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
from /var/www/myapp/current/config/environment.rb:10
from /var/www/myapp/current/script/delayed_job:3:in `require'
from /var/www/myapp/current/script/delayed_job:3
monit的狀態只是說執行失敗。
有你的目錄中登錄您的Rails.root? – shingara 2010-10-01 07:30:35
對不起,我不明白。日誌是在/ var/WWW/MYAPP /共享/日誌 – badnaam 2010-10-01 07:31:44