summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/cainstance.py4
-rw-r--r--ipaserver/install/dsinstance.py6
-rw-r--r--ipaserver/install/krbinstance.py30
3 files changed, 14 insertions, 26 deletions
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index c819957a6..fed4b2cdf 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -375,7 +375,7 @@ class CADSInstance(service.Service):
def restart_instance(self):
try:
ipaservices.knownservices.dirsrv.restart(self.serverid)
- if not dsinstance.is_ds_running():
+ if not dsinstance.is_ds_running(self.serverid):
logging.critical("Failed to restart the directory server. See the installation log for details.")
sys.exit(1)
except Exception:
@@ -693,7 +693,7 @@ class CAInstance(service.Service):
def __restart_instance(self):
try:
- self.restart()
+ self.restart(PKI_INSTANCE_NAME)
installutils.wait_for_open_ports('localhost', 9180, 300)
except Exception:
# TODO: roll back here?
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
index 36a386619..b0bbf423f 100644
--- a/ipaserver/install/dsinstance.py
+++ b/ipaserver/install/dsinstance.py
@@ -107,8 +107,8 @@ def check_ports():
ds_secure = installutils.port_available(636)
return (ds_unsecure, ds_secure)
-def is_ds_running():
- return ipaservices.knownservices.dirsrv.is_running()
+def is_ds_running(server_id=''):
+ return ipaservices.knownservices.dirsrv.is_running(instance_name=server_id)
def has_managed_entries(host_name, dm_password):
"""Check to see if the Managed Entries plugin is available"""
@@ -415,7 +415,7 @@ class DsInstance(service.Service):
def restart(self, instance=''):
try:
super(DsInstance, self).restart(instance)
- if not is_ds_running():
+ if not is_ds_running(instance):
logging.critical("Failed to restart the directory server. See the installation log for details.")
sys.exit(1)
installutils.wait_for_open_ports('localhost', self.open_ports, 300)
diff --git a/ipaserver/install/krbinstance.py b/ipaserver/install/krbinstance.py
index fbc802c3b..74e28bc66 100644
--- a/ipaserver/install/krbinstance.py
+++ b/ipaserver/install/krbinstance.py
@@ -320,28 +320,16 @@ class KrbInstance(service.Service):
min = version.LooseVersion(MIN_KRB5KDC_WITH_WORKERS)
if ver >= min:
workers = True
+ # Write down config file
+ # We write realm and also number of workers (for multi-CPU systems)
+ replacevars = {'KRB5REALM':self.realm}
+ appendvars = {}
if workers and cpus > 1:
- #read in memory, find KRB5KDC_ARGS, check/change it, then overwrite file
- self.fstore.backup_file("/etc/sysconfig/krb5kdc")
-
- need_w = True
- fd = open("/etc/sysconfig/krb5kdc", "r")
- lines = fd.readlines()
- fd.close()
- for line in lines:
- sline = line.strip()
- if not sline.startswith('KRB5KDC_ARGS'):
- continue
- sline = sline.replace('"', '')
- if sline.find("-w") != -1:
- need_w = False
-
- if need_w:
- fd = open("/etc/sysconfig/krb5kdc", "w")
- for line in lines:
- fd.write(line)
- fd.write('KRB5KDC_ARGS="${KRB5KDC_ARGS} -w %s"\n' % str(cpus))
- fd.close()
+ appendvars = {'KRB5KDC_ARGS': "-w %s" % str(cpus)}
+ ipautil.backup_config_and_replace_variables(self.fstore, "/etc/sysconfig/krb5kdc",
+ replacevars=replacevars,
+ appendvars=appendvars)
+ ipaservices.restore_context("/etc/sysconfig/krb5kdc")
def __write_stash_from_ds(self):
try: