agent icon indicating copy to clipboard operation
agent copied to clipboard

Systemd template file doesn't spawn unique agent names

Open jradtilbrook opened this issue 4 years ago • 2 comments

The template unit file intended for spawning multiple agents on one host doesn't start agents using unique names.

As the documentation states, you can run

sudo systemctl enable --now buildkite-agent@1
sudo systemctl enable --now buildkite-agent@2

But the default configuration file does not use the %n substitution.

I'm not sure if the the templated file is intended to be used with a number that tells it how many agents to spawn or a string that will be used in the agents name. ie

# spawn four agents with incrementing names using %n
sudo systemctl enable --now buildkite-agent@4

# or, run multiple units spawning one agent each, using the template to inject the unique name
sudo systemctl enable --now buildkite-agent@deploy
sudo systemctl enable --now buildkite-agent@build

jradtilbrook avatar Nov 05 '21 01:11 jradtilbrook

This feels related to the change we made to the default name (%n to %spawn) earlier in the year - #1389.

Maybe our documentation is out of date, and we should actually recommend running a single buildkite-agent systemd unit, with the spawn config option used to opt in to >1 agent?

yob avatar Nov 05 '21 02:11 yob

Oh yeah that makes sense. I wonder what the usage breakdown is of using the single unit vs the template intended to spawn multiple? Given we haven't heard much about this bug, perhaps the latter is rarely used and we could remove and do like you say

jradtilbrook avatar Nov 05 '21 04:11 jradtilbrook