首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gitlab安装问题- CentOS 7 (SELinux)

Gitlab安装问题- CentOS 7 (SELinux)
EN

Stack Overflow用户
提问于 2017-03-02 05:03:48
回答 1查看 1.2K关注 0票数 2

我正在CentOS 7(最小)上安装gitlab (8.17.2)。在基本安装之后,sudo gitlab-ctl reconfigure给出了以下错误:

在资源执行模块/opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp‘上执行操作run时出错

细节(到目前为止我所做的):

我首先安装/执行了以下依赖项:

代码语言:javascript
复制
yum check-update
sudo yum install curl policycoreutils openssh-server openssh-clients
sudo systemctl enable sshd
sudo systemctl start sshd
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

然后,我使用以下方法安装了gitlab (omnibus):

代码语言:javascript
复制
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce

它安装了最新的可用版本8.17.2。

我还没有定制/etc/gitlab/gitlab.rb。当我尝试使用以下方法重新配置gitlab时:

代码语言:javascript
复制
sudo gitlab-ctl reconfigure

我得到以下错误:

代码语言:javascript
复制
Recipe: gitlab::selinux
  * execute[semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp] action runsemodule: relocation error: semodule: symbol semanage_module_info_get_version, version LIBSEMANAGE_1.1 not defined in file libsemanage.so.1 with link time reference

    [execute] semodule: relocation error: semodule: symbol semanage_module_info_get_version, version LIBSEMANAGE_1.1 not defined in file libsemanage.so.1 with link time reference

    ================================================================================
    Error executing action `run` on resource 'execute[semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '127'
    ---- Begin output of semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp ----
    STDOUT:
    STDERR: semodule: relocation error: semodule: symbol semanage_module_info_get_version, version LIBSEMANAGE_1.1 not defined in file libsemanage.so.1 with link time reference
    ---- End output of semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp ----
    Ran semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp returned 127

    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/selinux.rb

     20:   execute "semodule -i /opt/gitlab/embedded/selinux/rhel/7/#{ssh_keygen_module}.pp" do
     21:     not_if "getenforce | grep Disabled"
     22:     not_if "semodule -l | grep '^#{ssh_keygen_module}\\s'"
     23:   end
     24: end

    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/selinux.rb:20:in `from_file'

    execute("semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp") do
      action [:run]
      retries 0
      retry_delay 2
      default_guard_interpreter :execute
      command "semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp"
      backup 5
      returns 0
      declared_type :execute
      cookbook_name "gitlab"
      recipe_name "selinux"
      not_if "getenforce | grep Disabled"
      not_if "semodule -l | grep '^gitlab-7.2.0-ssh-keygen\s'"
    end

    Platform:
    ---------
    x86_64-linux


Running handlers:
Running handlers complete
Chef Client failed. 3 resources updated in 03 seconds

注意,在以下文件中:/etc/sysconfig/selinux --如果我将SELINUX=enforcing更改为禁用并尝试重新配置,它就能正常工作。但我希望它能在不做这件事的情况下奏效。几个星期前,gitlab 8.16.0版就可以正常工作了。现在,即使我安装了8.0.16,我仍然会得到相同的错误。我遗漏了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-02 15:52:38

修复方法是安装以下代码来管理SELinux:

sudo yum install libsemanage-static libsemanage-devel

文档在这里没有提到这一点:https://about.gitlab.com/downloads/#centos7,参见这里的问题:https://gitlab.com/gitlab-org/omnibus-gitlab/issues/2051

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42547258

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档