Skip to content

Instantly share code, notes, and snippets.

@shuber
Forked from sj26/buildkite-agent.service
Created July 5, 2016 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shuber/f744128026798390ae95ab7d0919b7ef to your computer and use it in GitHub Desktop.
Save shuber/f744128026798390ae95ab7d0919b7ef to your computer and use it in GitHub Desktop.
Starting multiple buildkite-agents per-machine with systemd
[Unit]
Description=Buildkite Agents
Documentation=https://buildkite.com/agent
Wants=buildkite-agent@1.service
Wants=buildkite-agent@2.service
# ...
[Service]
Type=oneshot
ExecStart=/bin/true
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=Buildkite Agent %i
Documentation=https://buildkite.com/agent
BindsTo=buildkite-agent.service
After=syslog.target
After=network.target
[Service]
Type=simple
User=buildkite-agent
Environment=HOME=/var/lib/buildkite-agent
SyslogIdentifier=buildkite-agent-%i
ExecStart=/usr/bin/buildkite-agent start --name="%H-%i"
ReloadPropogatedFrom=buildkite-agent.service
RestartSec=5
Restart=on-failure
TimeoutSec=10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment