3

I am trying to make gitlab to run with a different user and I wasn't able to find any place where it has this configured.

I tried this because I need to use a NIS account to running it and in fact I even removed the git local user, created one on NIS and tried to restart it like this (after fixing the ownerships due to the UID and GID changes).

STDERR: usermod: user 'git' does not exist in /etc/passwd
---- End output of ["usermod", "-g", "10032", "-s", "/bin/sh", "git"] ----
Ran ["usermod", "-g", "10032", "-s", "/bin/sh", "git"] returned 6

Full log: https://gist.github.com/ssbarnea/83b9c07678187dfe238f

It is perfectly normal for the git user not to be inside the passwd file, is a NIS user. Also, I wasn't able to find where does gitlab gets the 10032 value for the user group, why is trying to reconfigure it or how can I customise or bypass this.

0

2 Answers 2

2

You would need first to create/have a different user in place.

And you would replace in the installation documentation all instances of:

  • sudo -u git with sudo -u yourNewUser
  • user git with the right user, as in /home/git/ replaced with /home/yourNewUser/

Check also the configuration file config/gitlab.yml:

# Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
# user: git
Sign up to request clarification or add additional context in comments.

2 Comments

I installed gitlab using the installed, meaning that the config files from /etc/gitlab are not gitlab.yml files but some gitlab.rb which seems to be used to overwrite what is in gitlab.yml using a different syntax. I do not need to change the username anymore, just the group, hoping that I will not get the error above anymore. ... I don't want to loose the config when I will have to upgrade. Thanks!
@sorin ok. I would modify one or the other gitlab.yml file, putting an obvious 'false' value, in order to trigger an error (and see which one is actually used)
2

Here is a bug report for this issue, relatively recent activity: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/737

The solution for me was to set the following in /etc/gitlab/gitlab.rb:

user['username'] = "git"
user['group'] = "git"
user['uid'] = 1040
user['gid'] = 1034
# # The shell for the git user
user['shell'] = "/bin/bash"
# # The home directory for the git user
user['home'] = "/var/home/git"

Adjust each value to match your existing NIS git user.

Then run gitlab-ctl reconfigure

To reiterate some comments on that bug report. Basically setting those values above will cause gitlab to decide it doesn't need to create any users.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.