Systemd template file doesn't spawn unique agent names
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
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?
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