diff options
author | Petr Viktorin <pviktori@redhat.com> | 2012-09-13 11:43:09 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2012-09-17 18:43:59 -0400 |
commit | f0829efe1f93bc80695b1e26d0edf792b31afd89 (patch) | |
tree | 355acba288e4917262b7d406358477f2a9cb9308 /ipaserver | |
parent | 4f76c143d2f2036af02677469c542f563a10158d (diff) | |
download | freeipa-f0829efe1f93bc80695b1e26d0edf792b31afd89.tar.gz freeipa-f0829efe1f93bc80695b1e26d0edf792b31afd89.tar.xz freeipa-f0829efe1f93bc80695b1e26d0edf792b31afd89.zip |
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
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/install/upgradeinstance.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ipaserver/install/upgradeinstance.py b/ipaserver/install/upgradeinstance.py index f1f702b1c..3c6bbec5b 100644 --- a/ipaserver/install/upgradeinstance.py +++ b/ipaserver/install/upgradeinstance.py @@ -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) |