capistrano - How do I configure monit to allow the change in pid? -
i deploying rails app sidekiq. on each deploy capistrano stops previous running version of sidekiq (a ruby process) , starts new one. monitoring sidekiq pid file monit.
problem: each time deploy pid file changes monit detects has changed , restarts process. on period of few days , multiple releases end multiple sidekiq instances when want one.
here monit config sidekiq:
check process sidekiq_main pidfile /srv/apps/orders/current/tmp/pids/sidekiq.pid every 3 cycles start program = "/bin/bash -c -l 'cd /srv/apps/orders/current ; nohup bundle exec sidekiq -e production -c /srv/apps/orders/current/config/sidekiq.yml -i 0 -p /srv/apps/orders/current/tmp/pids/sidekiq.pid >> /srv/apps/orders/current/log/sidekiq.log 2>&1 &'" stop program = "/bin/bash -c -l 'cd /srv/apps/orders/current ; bundle exec sidekiqctl stop /srv/apps/orders/current/tmp/pids/sidekiq.pid 10'" group sidekiq
is there way configure monit allow pid file change , make sure sidekiq instance running?
override default capistrano task ensure restarting sidekiq done through monit.
for example, add deploy.rb
namespace :sidekiq desc "restart sidekiq" task :restart, :roles => :app, :on_no_matching_servers => :continue run "sudo /usr/bin/monit restart sidekiq" end end
Comments
Post a Comment