Gitlab综合安装问题- CentOS 7 (SELinux)

时间:2022-01-05 02:56:59

I am working on installing gitlab-ce (8.17.2) on CentOS 7 (minimal). After basic installation, sudo gitlab-ctl reconfigure gives me this error:

我正在研究在CentOS 7(最小)上安装gitlabce(8.17.2)。在基本安装之后,sudo gitlab-ctl重新配置给我这个错误:

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

执行运行在资源上的错误执行[semodule -i /opt/gitlab/嵌入式/selinux/rhel/ gitlab-7.2.0-ssh-keygen.pp]

Details (What I did so far):

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

I installed/executed the following dependencies first:

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

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

Then I installed gitlab (omnibus) using the following:

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

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce

This installed the latest available version 8.17.2.

这安装了最新版本8.17.2。

I didn't customize /etc/gitlab/gitlab.rb yet. When I try to reconfigure gitlab using:

我没有定制/etc/gitlab/gitlab.rb。当我尝试重新配置gitlab时:

sudo gitlab-ctl reconfigure

I get the following error:

我得到了以下错误:

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

Note that in the following file: /etc/sysconfig/selinux If I change SELINUX=enforcing to disabled and try reconfiguring, it works just fine. But I was expecting it to work without doing this. It worked just fine a couple of weeks back with version gitlab 8.16.0. Now, even if I install 8.0.16, I still get the same error. What am I missing?

注意,在下面的文件中:如果我更改SELINUX=强制禁用并尝试重新配置,它可以正常工作。但我希望它能在不这样做的情况下工作。它在几周后就用了gitlab 8.16.0版本。现在,即使我安装8.0.16,仍然会得到相同的错误。我缺少什么?

1 个解决方案

#1


2  

The fix was to install the following to manage SELinux:

解决方案是安装以下操作来管理SELinux:

sudo yum install libsemanage-static libsemanage-devel

sudo yum安装libsemanage-static libsemanage-devel。

The documentation does not mention this here: https://about.gitlab.com/downloads/#centos7 See here for the issue: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/2051

在这里,文档没有提到这一点:https://about.gitlab.com/downloads/thecentos7。

#1


2  

The fix was to install the following to manage SELinux:

解决方案是安装以下操作来管理SELinux:

sudo yum install libsemanage-static libsemanage-devel

sudo yum安装libsemanage-static libsemanage-devel。

The documentation does not mention this here: https://about.gitlab.com/downloads/#centos7 See here for the issue: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/2051

在这里,文档没有提到这一点:https://about.gitlab.com/downloads/thecentos7。