无法在 Linux 上安装 GitHub 操作运行器

som*_*one 6 linux github github-actions github-actions-self-hosted-runners

我正在尝试按照 repo>settings>Actions>add runner 中描述的步骤在我的 Linux 机器(Ubuntu 20.04.1 LTS)上安装一个 GitHub 运行器。第一步工作正常,但是当我运行配置时:

./config.sh --url <repo URL> --token <token>

我收到以下失败消息:

ldd: ./bin/libSystem.Security.Cryptography.Native.OpenSsl.so: No such file or directory
ldd: ./bin/libSystem.IO.Compression.Native.so: No such file or directory
touch: cannot touch '.env': Permission denied
./env.sh: line 37: .path: Permission denied
./env.sh: line 32: .env: Permission denied
Unhandled exception. System.UnauthorizedAccessException: Access to the path '/actions-runner/_diag' is denied.
 ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at System.IO.FileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at GitHub.Runner.Common.HostTraceListener..ctor(String logFileDirectory, String logFilePrefix, Int32 pageSizeLimit, Int32 retentionDays)
   at GitHub.Runner.Common.HostContext..ctor(String hostType, String logFile)
   at GitHub.Runner.Listener.Program.Main(String[] args)
./config.sh: line 76: 10405 Aborted                 (core dumped) ./bin/Runner.Listener configure "$@"

Run Code Online (Sandbox Code Playgroud)

config.sh 不允许用户以 sudo 身份执行它,所以我修改了脚本以允许这样做,但权限问题仍然存在。有任何想法吗?

更新:我还通过在 /actions-runner 目录中运行以下命令安装了依赖项,但没有任何变化,错误消息仍然相同。

sudo ./bin/installdependencies.sh

Nel*_*les 16

当您选择运行程序时,请确保您在执行时使用正确的图像。

在此输入图像描述

  • 我不敢相信我犯了这个错误。 (6认同)

小智 2

扩展@someone的答案,我创建了一个快速循环,为位于github操作运行器的bin目录中的每一个重命名的库创建符号链接。运行 installdependency.sh 脚本后,它会为每个以“System”开头的文件创建一个符号链接。并将“lib”附加到原始文件名。

sudo ./bin/installdependencies.sh \
   && cd ./bin \
   && for lib in $(find . -name 'System.*'); do \
     toFile=$(echo "$lib" | sed -e 's/\.\/System\./.\/libSystem./g'); \
     if ! [ -f $toFile ]; then sudo ln -s $lib $toFile; fi; \
  done && cd ..
Run Code Online (Sandbox Code Playgroud)