If you see an error similar to the error shown below while using RedHat this is due to the launch agent executing the build agent being downloaded to a temporary directory which cannot be referenced due to noexec being turned on.
ERRO[2400] error running task error="allocation=\"xxxxxxx\" start failed: fork/exec /tmp/circleci-launch-agent2519696502/circleci-agent/1.0.143708-e64ffe64/linux/amd64/circleci-agent: permission denied"
Solution
To resolve this change the location of the temporary direction by setting the TMPDIR environment variable.
The directory used for the build agent is changed by adding the following to/etc/systemd/system/circleci.service
(using /opt/circleci/tmp for example):
Environment=TMPDIR=/opt/circleci/tmp
After making the addition, the file should resemble the following:
[Unit]
Description=CircleCI Runner
After=network.target
[Service]
ExecStart=/opt/circleci/circleci-launch-agent --config /opt/circleci/launch-agent-config.yaml
Environment=TMPDIR=/opt/circleci/tmp
Restart=always
User=root
NotifyAccess=exec
TimeoutStopSec=18300
[Install]
WantedBy = multi-user.target
Once this change has been made you should no longer see the issue and you should be able to build using runner.
Comments
Article is closed for comments.