diff --git a/master/buildbot/scripts/start.py b/master/buildbot/scripts/start.py index 78ddb361818..5b3a42bdfca 100644 --- a/master/buildbot/scripts/start.py +++ b/master/buildbot/scripts/start.py @@ -114,9 +114,13 @@ def launch(config): "--python=buildbot.tac"] # ProcessProtocol just ignores all output - reactor.spawnProcess( + proc = reactor.spawnProcess( protocol.ProcessProtocol(), sys.executable, argv, env=os.environ) + if platformType == "win32": + with open("twistd.pid", "w") as pidfile: + pidfile.write("{0}".format(proc.pid)) + def start(config): if not base.isBuildmasterDir(config['basedir']): diff --git a/master/buildbot/scripts/stop.py b/master/buildbot/scripts/stop.py index 0833f8319a4..a9419be406b 100644 --- a/master/buildbot/scripts/stop.py +++ b/master/buildbot/scripts/stop.py @@ -22,6 +22,8 @@ import signal import time +from twisted.python.runtime import platformType + from buildbot.scripts import base @@ -51,7 +53,7 @@ def stop(config, signame="TERM", wait=None): try: os.kill(pid, signum) except OSError as e: - if e.errno != errno.ESRCH: + if e.errno != errno.ESRCH and platformType != "win32": raise else: if not config['quiet']: