Eu usei o AWS Opsworks para criar alguns servidores. Eu tenho o Sidekiq rodando como parte do meu aplicativo Rails. Quando eu implantar o Sidekiq reinicia bem.
Estou configurando o Monit para assistir ao pid e iniciar e parar o Sidekiq se houver algum problema. No entanto, quando a Monit tenta iniciar o Sidekiq, vejo que o Ruby errado parece ser usado.
Oct 17 13:52:43 daitengu sidekiq: /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/definition.rb:361:in 'validate_ruby!': Your Ruby version is 1.8.7, but your Gemfile specified 1.9.3 (Bundler::RubyVersionMismatch)
Oct 17 13:52:43 daitengu sidekiq: from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler.rb:116:in 'setup'
Oct 17 13:52:43 daitengu sidekiq: from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/setup.rb:17
Quando eu executo o comando do cli Sidekiq lança corretamente.
$> cd /srv/www/myapp/current && RAILS_ENV=production nohup /usr/local/bin/bundle exec sidekiq -C config/sidekiq.yml >> /srv/www/myapp/shared/log/sidekiq.log 2>&1 &
$> ps -aef |grep sidekiq
root 1236 1235 8 20:54 pts/0 00:00:50 sidekiq 2.11.0 myapp [0 of 25 busy]
Meu arquivo sidekiq.monitrc
check process unicorn with pidfile /srv/www/myapp/shared/pids/unicorn.pid
start program = "/bin/bash -c 'cd /srv/www/myapp/current && /usr/local/bin/bundle exec unicorn_rails --env production --daemonize -c /srv/www/myapp/shared/config/unicorn.conf'"
stop program = "/bin/bash -c 'kill -QUIT 'cat /srv/www/myapp/shared/pids/unicorn.pid''"
Tags amazon-web-services monit