[buildbot] phase1, phase2: fix reconfig command by creating twistd.pid

LEDE Commits lede-commits at lists.infradead.org
Fri Mar 19 20:56:39 GMT 2021


ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/564eefcf29e83bd3d5481f367f7a3c102eb55fcf

commit 564eefcf29e83bd3d5481f367f7a3c102eb55fcf
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Fri Mar 19 21:54:30 2021 +0100

    phase1,phase2: fix reconfig command by creating twistd.pid
    
    Currently it's not possible to reconfig buildmaster as twistd.pid is
    missing so fix it by creating one manually.
    
    Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 phase1/master.cfg | 4 ++++
 phase2/master.cfg | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/phase1/master.cfg b/phase1/master.cfg
index 53d1812..363d77e 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -41,6 +41,10 @@ from buildbot.steps.transfer import StringDownload
 from buildbot.worker import Worker
 
 
+if not os.path.exists("twistd.pid"):
+    with open("twistd.pid", "w") as pidfile:
+        pidfile.write("{}".format(os.getpid()))
+
 # This is a sample buildmaster config file. It must be installed as
 # 'master.cfg' in your buildmaster's base directory.
 
diff --git a/phase2/master.cfg b/phase2/master.cfg
index a54c191..4d5e595 100644
--- a/phase2/master.cfg
+++ b/phase2/master.cfg
@@ -37,6 +37,10 @@ from buildbot.steps.transfer import StringDownload
 from buildbot.worker import Worker
 
 
+if not os.path.exists("twistd.pid"):
+    with open("twistd.pid", "w") as pidfile:
+        pidfile.write("{}".format(os.getpid()))
+
 ini = configparser.ConfigParser()
 ini.read(os.getenv("BUILDMASTER_CONFIG", "./config.ini"))
 



More information about the lede-commits mailing list