Skip to content

Commit 395e686

Browse files
committed
Add nested tabs for Linux service management options
1 parent 9c60877 commit 395e686

File tree

1 file changed

+69
-67
lines changed

1 file changed

+69
-67
lines changed

testing/new-buildbot-worker.rst

Lines changed: 69 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -298,73 +298,75 @@ machine reboots:
298298

299299
.. tab:: Linux
300300

301-
If you installed via a distro package (Fedora, RHEL, CentOS, Debian,
302-
Ubuntu, or FreeBSD), the service was already enabled in the installation
303-
step above.
304-
305-
**Manual systemd setup (pip installs)**
306-
307-
If you installed via pip, you need to install a systemd unit yourself.
308-
The upstream buildbot project provides a
309-
`contributed template unit <https://github.com/buildbot/buildbot/blob/master/worker/contrib/systemd/buildbot-worker%40.service>`__
310-
along with
311-
`sysusers.d and tmpfiles.d configs <https://github.com/buildbot/buildbot/tree/master/common/contrib/systemd>`__.
312-
313-
Create ``/etc/systemd/system/buildbot-worker@.service`` with the
314-
following contents::
315-
316-
[Unit]
317-
Description=Buildbot Worker %i
318-
Documentation=man:buildbot-worker(1) https://docs.buildbot.net/
319-
After=network.target
320-
ConditionDirectoryNotEmpty=/var/lib/buildbot/worker/%i
321-
ConditionFileNotEmpty=/var/lib/buildbot/worker/%i/buildbot.tac
322-
323-
[Service]
324-
Type=simple
325-
User=buildbot-worker
326-
Group=buildbot-worker
327-
WorkingDirectory=/var/lib/buildbot/worker/
328-
StateDirectory=buildbot/worker
329-
ExecStart=/usr/local/bin/buildbot-worker start --nodaemon %i
330-
Restart=always
331-
ProtectSystem=full
332-
ProtectHome=yes
333-
PrivateDevices=yes
334-
PrivateTmp=yes
335-
336-
[Install]
337-
WantedBy=multi-user.target
338-
339-
Adjust ``User``, ``Group``, ``WorkingDirectory``, and the
340-
``ExecStart`` path to match your setup. If your worker data is
341-
symlinked from ``/home`` (see the filesystem layout tip above),
342-
change ``ProtectHome=yes`` to ``ProtectHome=no`` so systemd can
343-
follow the symlink. Then::
344-
345-
systemctl daemon-reload
346-
systemctl enable --now buildbot-worker@WORKERNAME.service
347-
348-
**SysV init (non-systemd distros)**
349-
350-
For distros without systemd (such as Alpine Linux with OpenRC), upstream
351-
provides a
352-
`SysV init script <https://github.com/buildbot/buildbot/blob/master/worker/contrib/init-scripts/buildbot-worker.init.sh>`__
353-
with a
354-
`default configuration file <https://github.com/buildbot/buildbot/blob/master/worker/contrib/init-scripts/buildbot-worker.default>`__.
355-
Install these as ``/etc/init.d/buildbot-worker`` and
356-
``/etc/default/buildbot-worker`` respectively, then configure the worker
357-
instances in the default file.
358-
359-
**Cronjob alternative**
360-
361-
If neither systemd nor a SysV init script is practical, you can use a
362-
cronjob. Add the following line to ``/etc/crontab``::
363-
364-
@reboot buildbot-worker restart /path/to/workerdir
365-
366-
Note that ``restart`` is used rather than ``start`` in case a crash has
367-
left a ``twistd.pid`` file behind.
301+
.. tab:: Distro package
302+
303+
If you installed via a distro package (Fedora, RHEL, CentOS, Debian,
304+
or Ubuntu), the service was already enabled in the installation
305+
step above.
306+
307+
.. tab:: Manual systemd
308+
309+
If you installed via pip, you need to install a systemd unit yourself.
310+
The upstream buildbot project provides a
311+
`contributed template unit <https://github.com/buildbot/buildbot/blob/master/worker/contrib/systemd/buildbot-worker%40.service>`__
312+
along with
313+
`sysusers.d and tmpfiles.d configs <https://github.com/buildbot/buildbot/tree/master/common/contrib/systemd>`__.
314+
315+
Create ``/etc/systemd/system/buildbot-worker@.service`` with the
316+
following contents::
317+
318+
[Unit]
319+
Description=Buildbot Worker %i
320+
Documentation=man:buildbot-worker(1) https://docs.buildbot.net/
321+
After=network.target
322+
ConditionDirectoryNotEmpty=/var/lib/buildbot/worker/%i
323+
ConditionFileNotEmpty=/var/lib/buildbot/worker/%i/buildbot.tac
324+
325+
[Service]
326+
Type=simple
327+
User=buildbot-worker
328+
Group=buildbot-worker
329+
WorkingDirectory=/var/lib/buildbot/worker/
330+
StateDirectory=buildbot/worker
331+
ExecStart=/usr/local/bin/buildbot-worker start --nodaemon %i
332+
Restart=always
333+
ProtectSystem=full
334+
ProtectHome=yes
335+
PrivateDevices=yes
336+
PrivateTmp=yes
337+
338+
[Install]
339+
WantedBy=multi-user.target
340+
341+
Adjust ``User``, ``Group``, ``WorkingDirectory``, and the
342+
``ExecStart`` path to match your setup. If your worker data is
343+
symlinked from ``/home`` (see the filesystem layout tip above),
344+
change ``ProtectHome=yes`` to ``ProtectHome=no`` so systemd can
345+
follow the symlink. Then::
346+
347+
systemctl daemon-reload
348+
systemctl enable --now buildbot-worker@WORKERNAME.service
349+
350+
.. tab:: SysV init
351+
352+
For distros without systemd (such as Alpine Linux with OpenRC),
353+
upstream provides a
354+
`SysV init script <https://github.com/buildbot/buildbot/blob/master/worker/contrib/init-scripts/buildbot-worker.init.sh>`__
355+
with a
356+
`default configuration file <https://github.com/buildbot/buildbot/blob/master/worker/contrib/init-scripts/buildbot-worker.default>`__.
357+
Install these as ``/etc/init.d/buildbot-worker`` and
358+
``/etc/default/buildbot-worker`` respectively, then configure the
359+
worker instances in the default file.
360+
361+
.. tab:: Cronjob
362+
363+
If neither systemd nor a SysV init script is practical, you can use
364+
a cronjob. Add the following line to ``/etc/crontab``::
365+
366+
@reboot buildbot-worker restart /path/to/workerdir
367+
368+
Note that ``restart`` is used rather than ``start`` in case a crash
369+
has left a ``twistd.pid`` file behind.
368370

369371
.. tab:: macOS
370372

0 commit comments

Comments
 (0)