error: unable to unlink old ‘.gitlab-ci.yml‘: Permission denied

#gitlab-runner executes the code git pull origin xxx and reports error when updating: unable to unlink old '.gitlab-ci.yml': Permission denied

Problem environment: centos deploys gitlab-runner and executes the script using the shell selected
The cause of the problem: the gitlab-runner program process occupies and locks .gitlab-ci.yml

Solution:
After gitlab-runner stop stops the service, switch to the user who executes the gitlab-runner process. The execution user is: gitlab-runner. The user group is also: gitlab-runner.
Switch to the user: su gitlab-runner.
Enter the project directory and execute: git After pull origin xxx is confirmed to be successful, start the gitlab-runner service.
Start the gitlab-runner service: gitlab-runner start.
Re-run the automated deployment task to confirm the success.

Guess you like

Origin blog.csdn.net/m0_37678007/article/details/132622077