Closed guidodobboletta closed 7 months ago
Hi,
It's hard to maintain multi self-hosted runners under a same Linux user (such as root
), because:
The sudo useradd
command in this wrapper actually create one Linux local user for one self-hosted runner on the VM, as well as set the new user in both runners
and docker
groups, where runners
group can run sudo
without password on the VM, and docker
group enables the Docker CLI permissions. That is, the runner users can execute both sudo blablabla
and docker blablabla
by default. If any runner was already created on the VM, you can type sudo su - <runner-user-name>
and then check those permissions.
Meanwhile, this script does not need to be executed by root
, but by a Linux user with no-password sudo permission, since all root
permission required operations were all decorated with sudo
with in this script.
For your needs - <Start the runners as root single user>, you can try these solutions:
root
on your VM, referring to official method.sudo
if root
permission is required. This is also compatible with executing as root
.Hope these information works for you. 😄
I'm trying to use this wrapper script but the issue I'm having is that containers in github actions run as root so if you try to use this in combination with a workflow that requires containers then you'll get a permission error. I wanted to run this wrapper as root but there's a hardcoded
useradd
which obviously conflicts with the existing root user.