Skip to content

Commit

Permalink
Add pid file when on win32
Browse files Browse the repository at this point in the history
Added pid file to start.py
fixed stop.py to not error with posix error on win32
  • Loading branch information
dragon512 committed Apr 21, 2017
1 parent 7765ccd commit a7f3505
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 a7f3505

Please sign in to comment.