dev-util/buildbot: Added support for multiple service instances when using systemd.
authorMichael Seifert <mseifert@error-reports.org>
Thu, 10 Mar 2016 18:48:49 +0000 (19:48 +0100)
committerPatrice Clement <monsieurp@gentoo.org>
Wed, 30 Mar 2016 12:03:13 +0000 (12:03 +0000)
This commit adds support for starting multiple buildmaster instances using
systemd. A service configuration file allows to specify the filesystem location
of the buildmaster instances. A systemd target allows to start up or shut down
all buildmaster instances at once.

Gentoo-Bug: https://bugs.gentoo.org/570666
Closes: https://github.com/gentoo/gentoo/pull/1027

Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
dev-util/buildbot/buildbot-0.8.12-r2.ebuild
dev-util/buildbot/files/buildmaster.target [new file with mode: 0644]
dev-util/buildbot/files/buildmaster_at.service [new file with mode: 0644]
dev-util/buildbot/files/buildmaster_at.service.conf [new file with mode: 0644]

index 99f46ee2bb01ab561da519995cb308c00f58d2fb..c20323b55094c9b4342e258633ce0f486a43c8d1 100644 (file)
@@ -82,7 +82,9 @@ src_install() {
 
        newconfd "${FILESDIR}/buildmaster.confd" buildmaster
        newinitd "${FILESDIR}/buildmaster.initd" buildmaster
-       systemd_dounit "${FILESDIR}"/${PN}.service
+       systemd_dounit "${FILESDIR}/buildmaster.target"
+       systemd_newunit "${FILESDIR}/buildmaster_at.service" "buildmaster@.service"
+       systemd_install_serviced "${FILESDIR}/buildmaster_at.service.conf" "buildmaster@.service"
 
        readme.gentoo_create_doc
 }
diff --git a/dev-util/buildbot/files/buildmaster.target b/dev-util/buildbot/files/buildmaster.target
new file mode 100644 (file)
index 0000000..2bf1a36
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=Buildbot target that allows to start or stop all buildmaster@*.service instances
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dev-util/buildbot/files/buildmaster_at.service b/dev-util/buildbot/files/buildmaster_at.service
new file mode 100644 (file)
index 0000000..88f9f57
--- /dev/null
@@ -0,0 +1,16 @@
+[Unit]
+Description=buildbot master daemon
+After=local-fs.target network.target
+PartOf=buildmaster.target
+
+[Service]
+Environment=BASEDIR=/var/lib/buildmaster
+Type=forking
+User=buildbot
+ExecStartPre=/usr/bin/buildbot checkconfig ${BASEDIR}/%i
+ExecStart=/usr/bin/buildbot start ${BASEDIR}/%i
+ExecStop=/usr/bin/buildbot stop ${BASEDIR}/%i
+
+[Install]
+WantedBy=buildmaster.target
+
diff --git a/dev-util/buildbot/files/buildmaster_at.service.conf b/dev-util/buildbot/files/buildmaster_at.service.conf
new file mode 100644 (file)
index 0000000..baf1ae7
--- /dev/null
@@ -0,0 +1,5 @@
+# Uncomment the following lines to configure the base directory for all buildmaster instances.
+
+#[Service]
+#Environment=BASEDIR=/var/lib/buildmaster
+