it always runs as root.
adding
User=...
Group=...
to the service file doesn’t change anything.
using
steps:
- name: build
commands:
- su USERNAME -c '...'
also doesn’t help.
is there a way to run as non-root?
it always runs as root.
adding
User=...
Group=...
to the service file doesn’t change anything.
using
steps:
- name: build
commands:
- su USERNAME -c '...'
also doesn’t help.
is there a way to run as non-root?
the exec runner uses fork / exec to execute pipelines steps, which means it inherits the runner’s user profile and user group. To change the user or group, you can change the generated systemd file accordingly. make sure you re-start the service for these changes to take effect.
note that we generally recommend the docker runner, especially on linux where containers are natively supported. The benefit of the docker runner is pipelines are isolated from the host machine, and also you can take advantage of our plugin library. Of course, if your use case dictates that you must execute on the host machine without isolation, then the exec runner is the right choice.
editing the service file did work eventually, but it seems the runner can’t find Conan, which is installed via pip.
you probably need to configure the PATH to include conan. The exec runner provides an option to configure the PATH through the following environment variable:
using DRONE_RUNNER_PATH didn’t seem to help, still getting:
Traceback (most recent call last):
File "/home/desktop/.local/bin/conan", line 33, in <module>
sys.exit(load_entry_point('conan==1.29.2', 'console_scripts', 'conan')())
File "/home/desktop/.local/bin/conan", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
File "/usr/lib/python3.8/importlib/metadata.py", line 504, in distribution
return Distribution.from_name(distribution_name)
File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: conan