6

I've set up the Drone on my remote Ubuntu 18.04 Linux host. To make it easy I've installed drone-runner-exec. I've successfully connected it to my GitHub etc. So now it works fine, i.e. it clones the repository and begins to run my pipeline. One of steps is simple bash script that have to update subfolders in the repo.

steps:
- name: Getting subfolders
  commands:
  - ./my_script

The runner executes the script but fails on some points. After searching I've found the scripts executed under user I've installed the Drone. I see in ps aux output that both docker and drone run under root.

So my question - how can I change the system user under which the runner runs?

Nikolai Shevchenko
  • 7,083
  • 8
  • 33
  • 42
folibis
  • 12,048
  • 6
  • 54
  • 97

1 Answers1

4

A bit late for the OP, but I've just solved the same problem on my system (Ubuntu), so sharing it to help others navigated here.

Let's say someuser is the user you want to run the drone-runner-exec service with.

Follow the official docs to download and configure the exec runner, but create the config file in the home dir of your desired user. After that:

Install the service first, using the config file in your user home:

sudo drone-runner-exec service install --config="/home/someuser/.drone-runner-exec/config"

Override the service to use another user:

sudo systemctl edit drone-runner-exec

Save the override file with:

[Service]
User=someuser
Group=somegroup

Start the service:

sudo drone-runner-exec service start

Check:

ps -ef |grep drone-runner-exec

You should see someuser for the UID (instead of root)

szegheo
  • 4,175
  • 4
  • 31
  • 35