summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-replica-install
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-01-04 19:53:18 +0100
committerMartin Kosek <mkosek@redhat.com>2012-01-13 09:10:54 +0100
commit649d13b59746582ee19a7b40e454bc268b1b9be9 (patch)
tree4ed8bb931576247e735c131df88cf2b0e69b7eff /install/tools/ipa-replica-install
parent5550ee16071e5a1cf6c3a0f58c15865d730fe1e4 (diff)
downloadfreeipa-649d13b59746582ee19a7b40e454bc268b1b9be9.tar.gz
freeipa-649d13b59746582ee19a7b40e454bc268b1b9be9.tar.xz
freeipa-649d13b59746582ee19a7b40e454bc268b1b9be9.zip
Prevent service restart failures in ipa-replica-install
Call restart() methods of appropriate services instead of calling the system service restart command directly as service() method has a capability to wait until the service is fully up. Without this patch ipa-replica-install crashed on F-16 because krb5kdc service was started before dirsrv service was fully up. https://fedorahosted.org/freeipa/ticket/2139
Diffstat (limited to 'install/tools/ipa-replica-install')
-rwxr-xr-xinstall/tools/ipa-replica-install21
1 files changed, 16 insertions, 5 deletions
diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install
index fd772e571..dcf866202 100755
--- a/install/tools/ipa-replica-install
+++ b/install/tools/ipa-replica-install
@@ -152,6 +152,8 @@ def install_krb(config, setup_pkinit=False):
config.domain_name, config.dirman_password,
setup_pkinit, pkcs12_info)
+ return krb
+
def install_ca_cert(config):
cafile = config.dir + "/ca.crt"
if not ipautil.file_exists(cafile):
@@ -185,6 +187,8 @@ def install_http(config, auto_redirect):
print "error copying files: " + str(e)
sys.exit(1)
+ return http
+
def install_bind(config, options):
api.Backend.ldap2.connect(bind_dn="cn=Directory Manager",
bind_pw=config.dirman_password)
@@ -420,8 +424,8 @@ def main():
cs.add_simple_service('dogtagldap/%s@%s' % (config.host_name, config.realm_name))
cs.add_cert_to_service()
- install_krb(config, setup_pkinit=options.setup_pkinit)
- install_http(config, auto_redirect=options.ui_redirect)
+ krb = install_krb(config, setup_pkinit=options.setup_pkinit)
+ http = install_http(config, auto_redirect=options.ui_redirect)
if CA:
CA.import_ra_cert(dir + "/ra.p12")
CA.fix_ra_perms()
@@ -435,9 +439,16 @@ def main():
service.print_msg("Applying LDAP updates")
ds.apply_updates()
- ipaservices.knownservices.dirsrv.restart()
- ipaservices.knownservices.krb5kdc.restart()
- ipaservices.knownservices.httpd.restart()
+ # Restart ds and krb after configurations have been changed
+ service.print_msg("Restarting the directory server")
+ ds.restart()
+
+ service.print_msg("Restarting the KDC")
+ krb.restart()
+
+ # Restart httpd to pick up the new IPA configuration
+ service.print_msg("Restarting the web server")
+ http.restart()
if options.setup_dns:
install_bind(config, options)