Не получается получить отложенную работу для запуска с monit. вот мой файл delayed_job.monitrc ..
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
Я также пытался выполнить прямую команду, и это не сработает даже без монитора. Я должен быть в текущем каталоге, чтобы скрипт / 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
Мониторинг состояния просто говорит, что выполнение не удалось.