Commit 4017789f5aac8a8244e80c3f4feada5393c8a4ed
1 parent
1a6ba7e6
Exists in
master
and in
4 other branches
Only kill sidekiqs belonging to gitlab user
Showing
1 changed file
with
6 additions
and
4 deletions
Show diff stats
lib/tasks/gitlab/check.rake
... | ... | @@ -289,7 +289,6 @@ namespace :gitlab do |
289 | 289 | ######################## |
290 | 290 | |
291 | 291 | def check_gitlab_git_config |
292 | - gitlab_user = Gitlab.config.gitlab.user | |
293 | 292 | print "Git configured for #{gitlab_user} user? ... " |
294 | 293 | |
295 | 294 | options = { |
... | ... | @@ -664,8 +663,8 @@ namespace :gitlab do |
664 | 663 | puts "#{sidekiq_match.length}".red |
665 | 664 | try_fixing_it( |
666 | 665 | 'sudo service gitlab stop', |
667 | - 'sudo pkill -f sidekiq', | |
668 | - 'sleep 10 && sudo pkill -9 -f sidekiq', | |
666 | + "sudo pkill -u #{gitlab_user} -f sidekiq", | |
667 | + "sleep 10 && sudo pkill -9 -u #{gitlab_user} -f sidekiq", | |
669 | 668 | 'sudo service gitlab start' |
670 | 669 | ) |
671 | 670 | fix_and_rerun |
... | ... | @@ -709,10 +708,13 @@ namespace :gitlab do |
709 | 708 | end |
710 | 709 | |
711 | 710 | def sudo_gitlab(command) |
712 | - gitlab_user = Gitlab.config.gitlab.user | |
713 | 711 | "sudo -u #{gitlab_user} -H #{command}" |
714 | 712 | end |
715 | 713 | |
714 | + def gitlab_user | |
715 | + Gitlab.config.gitlab.user | |
716 | + end | |
717 | + | |
716 | 718 | def start_checking(component) |
717 | 719 | puts "Checking #{component.yellow} ..." |
718 | 720 | puts "" | ... | ... |