title: How do I configure monit to allow the change in pid?
body: <p>I am deploying a rails app with sidekiq. On each deploy Capistrano stops a previous running version of sidekiq (a ruby process) and then starts a new one. I am monitoring the sidekiq pid file with monit.</p>
  
  <p>Problem: Each time I deploy the pid file changes but monit detects that it has changed and restarts the process. Over the period of a few days and multiple releases I end up with multiple sidekiq instances when I only want one.</p>
  
  <p>Here is my monit config for sidekiq:</p>
  
  <pre><code>check process sidekiq_main with 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 &gt;&gt; /srv/apps/orders/current/log/sidekiq.log 2&gt;&amp;1 &amp;'"
    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
  </code></pre>
  
  <p>Is there a way to configure monit to allow for the pid file to change and only make sure that a sidekiq instance is running?</p>