首页 文章

gitlab-runner以root身份随机运行而不是用户gitlab-runner

提问于
浏览
1

我在自己的ubuntu服务器上有一个简单的gitlab-runner设置 . 它是使用以下注册的:

sudo gitlab-runner register -n --url https://gitlab.com/ --registration-token {{GITLAB_REGISTRATION_TOKEN}} --executor shell --description "{{GITLAB_RUNNER_DESCRIPTION}}"

正在运行的唯一gitlab-runner进程( ps -ef )是:

/usr/bin/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner

我的 /etc/gitlab-runner/config.toml 配置文件包含:

concurrent = 1
check_interval = 0

[[runners]]
  name = "iouze/landing"
  url = "https://gitlab.com/"
  token = "0530b.....6f9"
  executor = "shell"
  [runners.cache]

当我的CI管道触发时,作业有时会被用作gitlab-runner用户,在这种情况下它们会正确运行(作为一个sheell执行者) .

但有时,它以root身份运行,在这种情况下,它作为docker Actuator 运行,然后出错(因为脚本在意外的环境中运行) .

当服务上有明显的--user时,为什么它有时会以root身份运行?

1 回答

  • 0

    我在gitlab.com上运行,并且管道作业有时会被已经在那里配置的共享运行器拾起 . 我禁用了共享的跑步者

相关问题