public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Charalampos Stratakis <cstratak@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/buildbot] epel10.2: Use upstream systemd units with Fedora-specific drop-in overrides
Date: Fri, 09 Oct 2026 14:34:59 GMT	[thread overview]
Message-ID: <179155649933.1.11593271624387799478.rpms-buildbot-38bfbe26da40@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/buildbot
Branch : epel10.2
Commit : 38bfbe26da40176eaa26f504b77b7dd8c2900092
Author : Charalampos Stratakis <cstratak@redhat.com>
Date   : 2026-03-10T03:08:41+01:00
Stats  : +116/-19 in 5 file(s)
URL    : https://src.fedoraproject.org/rpms/buildbot/c/38bfbe26da40176eaa26f504b77b7dd8c2900092?branch=epel10.2

Log:
Use upstream systemd units with Fedora-specific drop-in overrides

---
diff --git a/buildbot-master-fedora.conf b/buildbot-master-fedora.conf
new file mode 100644
index 0000000..898bee9
--- /dev/null
+++ b/buildbot-master-fedora.conf
@@ -0,0 +1,24 @@
+# Fedora uses separate buildbot-worker / buildbot-master users and places
+# master data under /var/lib/buildbot/master/ instead of /var/lib/buildbot/.
+# ProtectHome=no allows symlinking master data from /home when the root
+# partition is too small.
+
+# Clear upstream conditions and set Fedora paths
+[Unit]
+ConditionDirectoryNotEmpty=
+ConditionDirectoryNotEmpty=/var/lib/buildbot/master/%i
+ConditionFileNotEmpty=
+ConditionFileNotEmpty=/var/lib/buildbot/master/%i/buildbot.tac
+ConditionFileNotEmpty=/var/lib/buildbot/master/%i/master.cfg
+
+[Service]
+User=buildbot-master
+Group=buildbot-master
+WorkingDirectory=/var/lib/buildbot/master/%i
+# Clear upstream StateDirectory=buildbot to avoid chown conflicts
+# with the separate buildbot-master user
+StateDirectory=
+# ExecStart must be cleared before override in drop-ins
+ExecStart=
+ExecStart=/usr/bin/buildbot start --nodaemon /var/lib/buildbot/master/%i
+ProtectHome=no

diff --git a/buildbot-master@.service b/buildbot-master@.service
index e60d75d..b995531 100644
--- a/buildbot-master@.service
+++ b/buildbot-master@.service
@@ -1,18 +1,35 @@
+# This template file assumes the buildbot master lives in a subdirectory of
+# /var/lib/buildbot
+# Usage:
+#   cd /var/lib/buildbot
+#   buildbot create-master [directory]
+#   systemctl enable --now buildbot-master@[directory].service
+# You may also want to install extra files per common/contrib/systemd/README.md
+# to create the buildbot user/group and the /var/lib/buildbot directory
+#
+# The service will not start unless the master directory and buildbot.tac
+# exist (see ConditionDirectoryNotEmpty/ConditionFileNotEmpty below).
+# StateDirectory ensures /var/lib/buildbot is created with correct ownership.
 [Unit]
-Description=Buildbot master %I
+Description=Buildbot Master %i
 Documentation=man:buildbot(1) https://docs.buildbot.net/
-ConditionDirectoryNotEmpty=/var/lib/buildbot/master/%i
-ConditionFileNotEmpty=/var/lib/buildbot/master/%i/buildbot.tac
-ConditionFileNotEmpty=/var/lib/buildbot/master/%i/master.cfg
+After=network.target
+ConditionDirectoryNotEmpty=/var/lib/buildbot/%i
+ConditionFileNotEmpty=/var/lib/buildbot/%i/buildbot.tac
 
 [Service]
 Type=simple
-WorkingDirectory=/var/lib/buildbot/master/%i
-PrivateTmp=true
-User=buildbot-master
-Group=buildbot-master
-ExecStart=/usr/bin/buildbot start --nodaemon
+User=buildbot
+Group=buildbot
+WorkingDirectory=/var/lib/buildbot
+StateDirectory=buildbot
+ExecStart=/usr/bin/buildbot --verbose start --nodaemon %i
 ExecReload=/bin/kill -HUP $MAINPID
+Restart=always
+ProtectSystem=full
+ProtectHome=yes
+PrivateDevices=yes
+PrivateTmp=yes
 
 [Install]
 WantedBy=multi-user.target

diff --git a/buildbot-worker-fedora.conf b/buildbot-worker-fedora.conf
new file mode 100644
index 0000000..04da4e8
--- /dev/null
+++ b/buildbot-worker-fedora.conf
@@ -0,0 +1,23 @@
+# Fedora uses separate buildbot-worker / buildbot-master users and places
+# worker data under /var/lib/buildbot/worker/ instead of /var/lib/buildbot/.
+# ProtectHome=no allows symlinking worker data from /home when the root
+# partition is too small.
+
+# Clear upstream conditions and set Fedora paths
+[Unit]
+ConditionDirectoryNotEmpty=
+ConditionDirectoryNotEmpty=/var/lib/buildbot/worker/%i
+ConditionFileNotEmpty=
+ConditionFileNotEmpty=/var/lib/buildbot/worker/%i/buildbot.tac
+
+[Service]
+User=buildbot-worker
+Group=buildbot-worker
+WorkingDirectory=/var/lib/buildbot/worker/%i
+# Clear upstream StateDirectory=buildbot to avoid chown conflicts
+# with the separate buildbot-worker user
+StateDirectory=
+# ExecStart must be cleared before override in drop-ins
+ExecStart=
+ExecStart=/usr/bin/buildbot-worker start --nodaemon /var/lib/buildbot/worker/%i
+ProtectHome=no

diff --git a/buildbot-worker@.service b/buildbot-worker@.service
index 9484bbe..e1b2385 100644
--- a/buildbot-worker@.service
+++ b/buildbot-worker@.service
@@ -1,16 +1,36 @@
+# This template file assumes the buildbot worker lives in a subdirectory of
+# /var/lib/buildbot
+# Usage:
+#   cd /var/lib/buildbot
+#   buildbot-worker create-worker [directory] [master hostname] [name] [password]
+#   systemctl enable --now buildbot-worker@[directory].service
+# You may also want to install extra files per common/contrib/systemd/README.md
+# to create the buildbot user/group and the /var/lib/buildbot directory
+#
+# The service will not start unless the worker directory and buildbot.tac
+# exist (see ConditionDirectoryNotEmpty/ConditionFileNotEmpty below).
+# StateDirectory ensures /var/lib/buildbot is created with correct ownership.
 [Unit]
-Description=Buildbot worker %I
+Description=Buildbot Worker %i
 Documentation=man:buildbot-worker(1) https://docs.buildbot.net/
-ConditionDirectoryNotEmpty=/var/lib/buildbot/worker/%i
-ConditionFileNotEmpty=/var/lib/buildbot/worker/%i/buildbot.tac
+After=network.target
+ConditionDirectoryNotEmpty=/var/lib/buildbot/%i
+ConditionFileNotEmpty=/var/lib/buildbot/%i/buildbot.tac
 
 [Service]
 Type=simple
-WorkingDirectory=/var/lib/buildbot/worker/%i
-PrivateTmp=true
-User=buildbot-worker
-Group=buildbot-worker
-ExecStart=/usr/bin/buildbot-worker start --nodaemon
+User=buildbot
+Group=buildbot
+WorkingDirectory=/var/lib/buildbot/
+StateDirectory=buildbot
+ExecStart=/usr/bin/buildbot-worker start --nodaemon %i
+# if using EC2 Latent worker, you want to uncomment following line, and comment out the Restart line
+# ExecStopPost=shutdown now
+Restart=always
+ProtectSystem=full
+ProtectHome=yes
+PrivateDevices=yes
+PrivateTmp=yes
 
 [Install]
 WantedBy=multi-user.target

diff --git a/buildbot.spec b/buildbot.spec
index 62e097e..bd8bece 100644
--- a/buildbot.spec
+++ b/buildbot.spec
@@ -20,7 +20,7 @@
 
 Name:           buildbot
 Version:        4.3.0
-Release:        6%{?dist}
+Release:        7%{?dist}
 
 Summary:        Build/test automation system
 License:        GPL-2.0-only
@@ -40,6 +40,10 @@ Source8:        %{pypi_source buildbot_pkg}
 Source10:       buildbot-master@.service
 Source11:       buildbot-worker@.service
 
+# Fedora-specific systemd drop-ins (separate users, paths)
+Source12:       buildbot-master-fedora.conf
+Source13:       buildbot-worker-fedora.conf
+
 BuildArch:      noarch
 
 BuildRequires:  python3-devel
@@ -153,6 +157,7 @@ done
 %dir %{_sharedstatedir}/buildbot
 %dir %attr(-, buildbot-master, buildbot-master) %{_sharedstatedir}/buildbot/master
 %{_unitdir}/buildbot-master@.service
+%{_unitdir}/buildbot-master@.service.d/fedora.conf
 
 # ---------------------------------------------------------------------
 %{_sysusersdir}/buildbot.conf
@@ -270,6 +275,7 @@ done
 %dir %{_sharedstatedir}/buildbot
 %dir %attr(-, buildbot-worker, buildbot-worker) %{_sharedstatedir}/buildbot/worker
 %{_unitdir}/buildbot-worker@.service
+%{_unitdir}/buildbot-worker@.service.d/fedora.conf
 %{_sysusersdir}/buildbot-worker.conf
 
 # ---------------------------------------------------------------------
@@ -392,9 +398,13 @@ popd
 # Purge windows-only files
 rm -vf %{buildroot}%{_bindir}/*windows*
 
-# Install systemd units
+# Install systemd units and Fedora drop-ins
 mkdir -p %{buildroot}%{_unitdir}
 cp -a %{S:10} %{S:11} %{buildroot}%{_unitdir}
+mkdir -p %{buildroot}%{_unitdir}/buildbot-master@.service.d
+install -m0644 %{S:12} %{buildroot}%{_unitdir}/buildbot-master@.service.d/fedora.conf
+mkdir -p %{buildroot}%{_unitdir}/buildbot-worker@.service.d
+install -m0644 %{S:13} %{buildroot}%{_unitdir}/buildbot-worker@.service.d/fedora.conf
 mkdir -p %{buildroot}%{_sharedstatedir}/buildbot/{master,worker}
 
 
@@ -405,6 +415,9 @@ trial buildbot.test
 %endif
 
 %changelog
+* Mon Mar 09 2026 Charalampos Stratakis <cstratak@redhat.com> - 4.3.0-7
+- Harden systemd template units
+
 * Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.0-6
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
 

                 reply	other threads:[~2026-10-09 14:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179155649933.1.11593271624387799478.rpms-buildbot-38bfbe26da40@fedoraproject.org \
    --to=cstratak@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox