This fixes a 2.2→3.0 upgrade bug found while testing the Dogtag 10 work.
See commit or ticket for details.
https://fedorahosted.org/freeipa/ticket/3083
I also suspect that waiting for ports is not a good way to check if the
CMS is fully initialized, but I don't know of a better way. If you know
one, please speak up.
--
Petr³
From 4d5f1869572a552bde393d78c5d16d08a351acaf Mon Sep 17 00:00:00 2001
From: Petr Viktorin <[email protected]>
Date: Thu, 13 Sep 2012 11:43:09 -0400
Subject: [PATCH] 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
---
ipaserver/install/upgradeinstance.py | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/ipaserver/install/upgradeinstance.py b/ipaserver/install/upgradeinstance.py
index f1f702b1c51eed0277fd4f02f5c1d4048292d894..3c6bbec5b386768ed951dffc65fcdb34f3014dad 100644
--- a/ipaserver/install/upgradeinstance.py
+++ b/ipaserver/install/upgradeinstance.py
@@ -59,19 +59,24 @@ def __init__(self, realm_name, files=[], live_run=True):
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)
--
1.7.11.4
_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel