2014-10-01 32 views
3

我想讓gitlab和其他用戶一起運行,我無法找到它配置的地方。如何讓gitlab使用不同於git的用戶?

我試過這個,因爲我需要使用一個NIS帳戶來運行它,實際上我甚至刪除了git本地用戶,在NIS上創建了一個,並嘗試像這樣重新啓動它(修復了歸屬於UID的所有權後, GID改變)。

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 

完整的日誌:https://gist.github.com/ssbarnea/83b9c07678187dfe238f

這是完全正常的git的用戶不被passwd文件裏面,是一個NIS用戶。另外,我無法找到gitlab從哪裏獲得用戶組的10032值,爲什麼要重新配置它,或者我如何自定義或繞過此操作。

回答

2

您需要先到create/have a different user in place

而且你會在的installation documentation所有實例替換:

  • sudo -u gitsudo -u yourNewUser
  • 用戶git用正確的用戶,如/home/git//home/yourNewUser/

檢查也可以對配置替代文件config/gitlab.yml

# Uncomment and customize if you can't use the default user to run GitLab (default: 'git') 
# user: git 
+0

我使用安裝的gitlab,意思是來自/ etc/gitlab的配置文件不是'gitlab.yml'文件,而是一些'gitlab.rb',它似乎被用來覆蓋'gitlab.yml'中的內容使用不同的語法。我不需要再改變用戶名,只需要小組,希望我不會再遇到上述錯誤。 ......當我不得不升級時,我不想失去配置。謝謝! – sorin 2014-10-01 15:25:57

+0

@sorin ok。我會修改其中一個或另一個gitlab.yml文件,並放置一個明顯的'false'值,以便觸發一個錯誤(並查看實際使用的錯誤)。 – VonC 2014-10-01 15:28:00

+0

如果您使用的是GitLab Omni軟件包,請參閱我的答案。 – Halsafar 2016-01-06 22:15:24

2

下面是此問題的錯誤報告,比較新的活動: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/737

對我來說,解決辦法是設置在/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" 

調整每個值都與您現有的NIS git用戶相匹配。

然後運行gitlab-CTL重新配置

重申對錯誤報告的一些意見。基本上設置這些值將導致gitlab決定它不需要創建任何用戶。

相關問題