Only stop the main DS instance when upgrading it

We've been stopping both DS instances (main and PKI) when upgrading.
This can happen while the CA is running. In some cases stopping the PKI
DS also killed the CA.

Only stop the specific instance for upgrades.

Also, wait for open ports after the upgrade is complete. The wait was
skipped previously. This can prevent bugs if scripts that need a DS are
run after the upgrade.

https://fedorahosted.org/freeipa/ticket/3083
This commit is contained in:
Petr Viktorin
2012-09-13 11:43:09 -04:00
committed by Rob Crittenden
parent 4f76c143d2
commit f0829efe1f

View File

@@ -59,19 +59,24 @@ class IPAUpgrade(service.Service):
self.modified = False
self.badsyntax = False
self.upgradefailed = False
self.serverid = serverid
def start(self, instance_name="", capture_output=True, wait=True):
def __start_nowait(self):
# Don't wait here because we've turned off port 389. The connection
# we make will wait for the socket.
super(IPAUpgrade, self).start(instance_name, capture_output, wait=False)
super(IPAUpgrade, self).start(wait=False)
def __stop_instance(self):
"""Stop only the main DS instance"""
super(IPAUpgrade, self).stop(self.serverid)
def create_instance(self):
self.step("stopping directory server", self.stop)
self.step("stopping directory server", self.__stop_instance)
self.step("saving configuration", self.__save_config)
self.step("disabling listeners", self.__disable_listeners)
self.step("starting directory server", self.start)
self.step("starting directory server", self.__start_nowait)
self.step("upgrading server", self.__upgrade)
self.step("stopping directory server", self.stop)
self.step("stopping directory server", self.__stop_instance)
self.step("restoring configuration", self.__restore_config)
self.step("starting directory server", self.start)