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,7 +289,6 @@ namespace :gitlab do | ||
289 | ######################## | 289 | ######################## |
290 | 290 | ||
291 | def check_gitlab_git_config | 291 | def check_gitlab_git_config |
292 | - gitlab_user = Gitlab.config.gitlab.user | ||
293 | print "Git configured for #{gitlab_user} user? ... " | 292 | print "Git configured for #{gitlab_user} user? ... " |
294 | 293 | ||
295 | options = { | 294 | options = { |
@@ -664,8 +663,8 @@ namespace :gitlab do | @@ -664,8 +663,8 @@ namespace :gitlab do | ||
664 | puts "#{sidekiq_match.length}".red | 663 | puts "#{sidekiq_match.length}".red |
665 | try_fixing_it( | 664 | try_fixing_it( |
666 | 'sudo service gitlab stop', | 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 | 'sudo service gitlab start' | 668 | 'sudo service gitlab start' |
670 | ) | 669 | ) |
671 | fix_and_rerun | 670 | fix_and_rerun |
@@ -709,10 +708,13 @@ namespace :gitlab do | @@ -709,10 +708,13 @@ namespace :gitlab do | ||
709 | end | 708 | end |
710 | 709 | ||
711 | def sudo_gitlab(command) | 710 | def sudo_gitlab(command) |
712 | - gitlab_user = Gitlab.config.gitlab.user | ||
713 | "sudo -u #{gitlab_user} -H #{command}" | 711 | "sudo -u #{gitlab_user} -H #{command}" |
714 | end | 712 | end |
715 | 713 | ||
714 | + def gitlab_user | ||
715 | + Gitlab.config.gitlab.user | ||
716 | + end | ||
717 | + | ||
716 | def start_checking(component) | 718 | def start_checking(component) |
717 | puts "Checking #{component.yellow} ..." | 719 | puts "Checking #{component.yellow} ..." |
718 | puts "" | 720 | puts "" |