Commit b5d7bcb7842d7a63de332e998d2c11ba3a5e1e6d

Authored by Johannes Schleifenbaum
1 parent 72dd8011

[gitlab:check] Fix detecting the status of sidekiq

If you are running another sidekiq instance on your server, e.g. GitLab
CI, the check script would parse the output of `ps aux` searching for
`sidekiq` and returning success, although the GitLab sidekiq may not be
running.

Now the `ps` call will only print the processes run by the GitLab user.
Showing 1 changed file with 1 additions and 2 deletions   Show diff stats
lib/tasks/gitlab/check.rake
... ... @@ -663,7 +663,6 @@ namespace :gitlab do
663 663 else
664 664 puts "#{sidekiq_match.length}".red
665 665 try_fixing_it(
666   - 'Unless you are running another Rails application on this server there should only be one Sidekiq process.',
667 666 'sudo service gitlab stop',
668 667 'sudo pkill -f sidekiq',
669 668 'sleep 10 && sudo pkill -9 -f sidekiq',
... ... @@ -674,7 +673,7 @@ namespace :gitlab do
674 673 end
675 674  
676 675 def sidekiq_process_match
677   - run_and_match("ps aux | grep -i sidekiq", /(sidekiq \d+\.\d+\.\d+.+$)/)
  676 + run_and_match("ps ux | grep -i sidekiq", /(sidekiq \d+\.\d+\.\d+.+$)/)
678 677 end
679 678 end
680 679  
... ...