summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/dsinstance.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-04-21 16:43:10 -0400
committerMartin Kosek <mkosek@redhat.com>2011-04-22 11:43:50 +0200
commit46a341142079d1722647d24d06155346fc1c8442 (patch)
tree66e716279075c0381016158c242ec0dbe589807d /ipaserver/install/dsinstance.py
parentd2be41dd1b69020b11cdd6ba66436424f3a0033a (diff)
downloadfreeipa-46a341142079d1722647d24d06155346fc1c8442.zip
freeipa-46a341142079d1722647d24d06155346fc1c8442.tar.gz
freeipa-46a341142079d1722647d24d06155346fc1c8442.tar.xz
Wait for memberof task and DS to start before proceeding in installation.
This was causing a replica DS instance to crash if the task was not completed when we attempted a shutdown to do a restart. In replication.py we were restarting the DS instance without waiting for the ports to become available. It is unlikely that the dn of the memberof task will change but just in case I noted it in the two places it is referenced. ticket 1188
Diffstat (limited to 'ipaserver/install/dsinstance.py')
-rw-r--r--ipaserver/install/dsinstance.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
index 5541264..38195c7 100644
--- a/ipaserver/install/dsinstance.py
+++ b/ipaserver/install/dsinstance.py
@@ -427,6 +427,13 @@ class DsInstance(service.Service):
def init_memberof(self):
self._ldap_mod("memberof-task.ldif", self.sub_dict)
+ # Note, keep dn in sync with dn in install/share/memberof-task.ldif
+ dn = "cn=IPA install %s,cn=memberof task,cn=tasks,cn=config" % self.sub_dict["TIME"]
+ logging.debug("Waiting for memberof task to complete.")
+ conn = ipaldap.IPAdmin("127.0.0.1")
+ conn.simple_bind_s("cn=directory manager", self.dm_password)
+ conn.checkTask(dn, dowait=True)
+ conn.unbind()
def apply_updates(self):
ld = ldapupdate.LDAPUpdate(dm_password=self.dm_password, sub_dict=self.sub_dict)