Skip to content

Install Runner in /usr/bin and helper in /usr/lib in Linux

Pedro Pombeiro requested to merge 3440-fix-linux-selinux-issue into master

What does this MR do?

This MR changes the .deb and .rpm packages so that they install the Runner binary directly in /usr/bin instead of /usr/lib/gitlab-runner with a symlink on /usr/bin.

Why was this MR needed?

See #3440 (closed) and #22963 (closed)

Are there points in the code the reviewer needs to double check?

I've tested installing the previous package in a Fedora 28 VM, and then upgrading to the new version with sudo yum localinstall, and the /etc/systemd/system/gitlab-runner.service file was updated to point to /usr/bin/gitlab-runner as expected.

Previous version failed to check for new builds with:

status=couldn't execute POST against https://gitlab.com/api/v4/jobs/request: Post https://gitlab.com/api/v4/jobs/request: dial tcp 172.65.251.78:443: connect: permission denied

As soon as I updated to the new Runner, the job was picked up and completed successfully with the docker executor.

Steps to test

On a Fedora 28 VM:

  1. Check that SELinux is in Enforcing mode:
    $ /usr/sbin/getenforce
    Enforcing
  2. Install Docker
    sudo dnf install -y moby-engine
    sudo systemctl start docker
    sudo gpasswd -a $USER docker
    sudo setfacl -m user:$USER:rw /var/run/docker.sock
  3. Install current gitlab-runner RPM package (not from this MR) to verify broken behaviour
    sudo yum localinstall -y gitlab-runner_amd64.rpm
  4. Register runner and run a build against this runner.
  5. Install RPM package from this MR, and after it upgrades, retry the build. It should complete just fine.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Closes #3440 (closed)

Edited by Steve Xuereb

Merge request reports