Skip to content

gitlab-ctl reconfigure fails on sysctl because /sys is readonly

I'm trying to run the gitlab ce RHEL 7 RPM inside a container with /sys mounted readonly. The gitlab-ctl reconfigure script fails with:

    Expected process to exit with [0], but received '255'
    ---- Begin output of /sbin/sysctl -p /etc/sysctl.conf ----
    STDOUT:
    STDERR: sysctl: setting key "kernel.shmmax": Read-only file system
    sysctl: setting key "kernel.shmall": Read-only file system
    ---- End output of /sbin/sysctl -p /etc/sysctl.conf ----
    Ran /sbin/sysctl -p /etc/sysctl.conf returned 255

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

     39:   execute "sysctl" do
     40:     command "/sbin/sysctl -p /etc/sysctl.conf"
     41:     action :nothing
     42:   end
     43:

I've removed all the sysctl changes from /opt/gitlab/embedded/cookbooks/gitlab/recipes/unicorn.rb which allows reconfigure to complete, but I think the script should be a bit more tolerant about running in a limited container.