Skip to content

Commit

Permalink
Merge pull request #3133 from dragon512/win32-pid-fix
Browse files Browse the repository at this point in the history
add tweaks to allow buildbot to start and stop nicely on win32
  • Loading branch information
tardyp committed Apr 24, 2017
2 parents bcf4732 + a7f3505 commit 1dc41f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion master/buildbot/scripts/start.py
Expand Up @@ -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']):
Expand Down
4 changes: 3 additions & 1 deletion master/buildbot/scripts/stop.py
Expand Up @@ -22,6 +22,8 @@
import signal
import time

from twisted.python.runtime import platformType

from buildbot.scripts import base


Expand Down Expand Up @@ -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']:
Expand Down

0 comments on commit 1dc41f4

Please sign in to comment.