From 18542cd165d047cba69ed2b3ac12e59993bf2fb0 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Mon, 14 Mar 2011 17:56:17 +0100 Subject: Wait for Directory Server ports to open When Directory Server operation is run right after the server restart the listening ports may not be opened yet. This makes the installation fail. This patch fixes this issue by waiting for both secure and insecure Directory Server ports to open after every restart. https://fedorahosted.org/freeipa/ticket/1076 --- ipaserver/install/cainstance.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'ipaserver/install/cainstance.py') diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py index 83f3aa7b9..2ada2b732 100644 --- a/ipaserver/install/cainstance.py +++ b/ipaserver/install/cainstance.py @@ -733,18 +733,7 @@ class CAInstance(service.Service): def __restart_instance(self): try: self.restart() - # Wait until the dogtag webapp responds - while True: - try: - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.connect(('localhost', 9180)) - s.close() - break - except socket.error, e: - if e.errno == 111: # Connection refused - time.sleep(1) - else: - raise e + installutils.wait_for_open_ports('localhost', 9180, 300) except Exception: # TODO: roll back here? logging.critical("Failed to restart the certificate server. See the installation log for details.") -- cgit