summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/python/samba/provisionbackend.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/provisionbackend.py b/source4/scripting/python/samba/provisionbackend.py
index 25e416ce04..8d035ab670 100644
--- a/source4/scripting/python/samba/provisionbackend.py
+++ b/source4/scripting/python/samba/provisionbackend.py
@@ -222,6 +222,7 @@ class LDAPBackend(ProvisionBackend):
self.slapd = subprocess.Popen(self.slapd_provision_command,
close_fds=True, shell=False)
+ count = 0
while self.slapd.poll() is None:
# Wait until the socket appears
try:
@@ -232,6 +233,11 @@ class LDAPBackend(ProvisionBackend):
return
except LdbError:
time.sleep(1)
+ count = count + 1
+
+ if count > 15:
+ self.message("Could not connect to slapd started with: %s" % "\'" + "\' \'".join(self.slapd_provision_command) + "\'")
+ raise ProvisioningError("slapd never accepted a connection within 15 seconds of starting")
self.message("Could not start slapd with: %s" % "\'" + "\' \'".join(self.slapd_provision_command) + "\'")
raise ProvisioningError("slapd died before we could make a connection to it")