mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Centralize timeout for waiting for servers to start.
All service start/restart currently go through ipapython/platform so move the "wait for service to start" code there as well. A dictionary of known services and ports to wait on is defined in base.py This is referenced by the platforms by instance name to determine what to wait for. For the case of dirsrv if we get that as a plain name (no specific instance) it is assumed to be the main IPA service. https://fedorahosted.org/freeipa/ticket/2375 https://fedorahosted.org/freeipa/ticket/2610
This commit is contained in:
@@ -35,6 +35,8 @@ from ipapython.ipa_log_manager import *
|
||||
|
||||
CACERT = "/etc/ipa/ca.crt"
|
||||
|
||||
# The service name as stored in cn=masters,cn=ipa,cn=etc. In the tuple
|
||||
# the first value is the *nix service name, the second the start order.
|
||||
SERVICE_LIST = {
|
||||
'KDC':('krb5kdc', 10),
|
||||
'KPASSWD':('kadmin', 20),
|
||||
@@ -198,11 +200,11 @@ class Service(object):
|
||||
def stop(self, instance_name="", capture_output=True):
|
||||
self.service.stop(instance_name, capture_output=capture_output)
|
||||
|
||||
def start(self, instance_name="", capture_output=True):
|
||||
self.service.start(instance_name, capture_output=capture_output)
|
||||
def start(self, instance_name="", capture_output=True, wait=True):
|
||||
self.service.start(instance_name, capture_output=capture_output, wait=wait)
|
||||
|
||||
def restart(self, instance_name="", capture_output=True):
|
||||
self.service.restart(instance_name, capture_output=capture_output)
|
||||
def restart(self, instance_name="", capture_output=True, wait=True):
|
||||
self.service.restart(instance_name, capture_output=capture_output, wait=wait)
|
||||
|
||||
def is_running(self):
|
||||
return self.service.is_running()
|
||||
|
||||
Reference in New Issue
Block a user