Commit 6f037b9fe89290333a744d5d2a283b50880e14c0
Exists in
master
and in
4 other branches
Merge branch 'argument_error_in_gitlab_check' of /home/git/repositories/gitlab/gitlabhq
Showing
2 changed files
with
9 additions
and
3 deletions
Show diff stats
lib/tasks/gitlab/check.rake
... | ... | @@ -479,11 +479,13 @@ namespace :gitlab do |
479 | 479 | return |
480 | 480 | end |
481 | 481 | |
482 | - if File.stat(repo_base_path).uid == uid_for(gitlab_shell_ssh_user) && | |
483 | - File.stat(repo_base_path).gid == gid_for(gitlab_shell_owner_group) | |
482 | + uid = uid_for(gitlab_shell_ssh_user) | |
483 | + gid = gid_for(gitlab_shell_owner_group) | |
484 | + if File.stat(repo_base_path).uid == uid && File.stat(repo_base_path).gid == gid | |
484 | 485 | puts "yes".green |
485 | 486 | else |
486 | 487 | puts "no".red |
488 | + puts " User id for #{gitlab_shell_ssh_user}: #{uid}. Groupd id for #{gitlab_shell_owner_group}: #{gid}".blue | |
487 | 489 | try_fixing_it( |
488 | 490 | "sudo chown -R #{gitlab_shell_ssh_user}:#{gitlab_shell_owner_group} #{repo_base_path}" |
489 | 491 | ) | ... | ... |
lib/tasks/gitlab/task_helpers.rake
... | ... | @@ -80,7 +80,11 @@ namespace :gitlab do |
80 | 80 | end |
81 | 81 | |
82 | 82 | def gid_for(group_name) |
83 | - Etc.getgrnam(group_name).gid | |
83 | + begin | |
84 | + Etc.getgrnam(group_name).gid | |
85 | + rescue ArgumentError # no group | |
86 | + "group #{group_name} doesn't exist" | |
87 | + end | |
84 | 88 | end |
85 | 89 | |
86 | 90 | def warn_user_is_not_gitlab | ... | ... |