summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/bitbake2
-rw-r--r--lib/bb/cooker.py8
-rw-r--r--lib/bb/cookerdata.py1
-rw-r--r--lib/bb/server/xmlrpc.py7
4 files changed, 16 insertions, 2 deletions
diff --git a/bin/bitbake b/bin/bitbake
index a0a2baa4b..5857b9242 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -208,8 +208,10 @@ def start_server(servermodule, configParams, configuration):
if configParams.bind:
(host, port) = configParams.bind.split(':')
server.initServer((host, int(port)))
+ configuration.interface = [ server.serverImpl.host, server.serverImpl.port ]
else:
server.initServer()
+ configuration.interface = []
try:
configuration.setServerRegIdleCallback(server.getServerIdleCB())
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index b36ed6fe3..7b10f8068 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -125,6 +125,14 @@ class BBCooker:
self.lock = bb.utils.lockfile(lockfile, False, False)
if not self.lock:
bb.fatal("Only one copy of bitbake should be run against a build directory")
+ try:
+ self.lock.seek(0)
+ self.lock.truncate()
+ if len(configuration.interface) >= 2:
+ self.lock.write("%s:%s\n" % (configuration.interface[0], configuration.interface[1]));
+ self.lock.flush()
+ except:
+ pass
# TOSTOP must not be set or our children will hang when they output
fd = sys.stdout.fileno()
diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index e640ed0f3..6200b0eba 100644
--- a/lib/bb/cookerdata.py
+++ b/lib/bb/cookerdata.py
@@ -127,6 +127,7 @@ class CookerConfiguration(object):
self.dump_signatures = False
self.dry_run = False
self.tracking = False
+ self.interface = []
self.env = {}
diff --git a/lib/bb/server/xmlrpc.py b/lib/bb/server/xmlrpc.py
index 3a67ab0cf..46d074a73 100644
--- a/lib/bb/server/xmlrpc.py
+++ b/lib/bb/server/xmlrpc.py
@@ -198,6 +198,11 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
Constructor
"""
BaseImplServer.__init__(self)
+ if (interface[1] == 0): # anonymous port, not getting reused
+ self.single_use = True
+ # Use auto port configuration
+ if (interface[1] == -1):
+ interface = (interface[0], 0)
SimpleXMLRPCServer.__init__(self, interface,
requestHandler=BitBakeXMLRPCRequestHandler,
logRequests=False, allow_none=True)
@@ -208,8 +213,6 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
self.autoregister_all_functions(self.commands, "")
self.interface = interface
self.single_use = False
- if (interface[1] == 0): # anonymous port, not getting reused
- self.single_use = True
def addcooker(self, cooker):
BaseImplServer.addcooker(self, cooker)