When IPA replica or server is configured it does not check for
possibly installed client. This will cause the installation to
fail in the very end.

This patch adds a check for already configured client and suggests
removing it before server/replica installation.

https://fedorahosted.org/freeipa/ticket/1002

>From 4a613d47417123402e2d7c1d05dafb992b0fc03a Mon Sep 17 00:00:00 2001
From: Martin Kosek <mko...@redhat.com>
Date: Thu, 24 Feb 2011 13:02:27 +0100
Subject: [PATCH] IPA replica/server install does not check for a client

When IPA replica or server is configured it does not check for
possibly installed client. This will cause the installation to
fail in the very end.

This patch adds a check for already configured client and suggests
removing it before server/replica installation.

https://fedorahosted.org/freeipa/ticket/1002
---
 install/tools/ipa-replica-install |    5 +++++
 install/tools/ipa-server-install  |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install
index 590fd645b449621161ffb4464e645bac016a23a8..17f5cbc3742da462fec9ee72da84eb0035ad7361 100755
--- a/install/tools/ipa-replica-install
+++ b/install/tools/ipa-replica-install
@@ -343,6 +343,11 @@ def main():
     if not ipautil.file_exists(filename):
         sys.exit("Replica file %s does not exist" % filename)
 
+    client_fstore = sysrestore.FileStore('/var/lib/ipa-client/sysrestore')
+    if client_fstore.has_files():
+        sys.exit("IPA client is already configured on this system.\n"
+                 + "Please uninstall it first before configuring the replica.")
+
     global sstore
     sstore = sysrestore.StateFile('/var/lib/ipa/sysrestore')
 
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 6ae02d89398baf7795a55424474407b08b128a1d..6fd393362d624acb3b7a474dbaa342f653d6c1f7 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -481,6 +481,11 @@ def main():
         if (dsinstance.DsInstance().is_configured() or cainstance.CADSInstance().is_configured()) and not options.external_cert_file:
             sys.exit("IPA server is already configured on this system.")
 
+        client_fstore = sysrestore.FileStore('/var/lib/ipa-client/sysrestore')
+        if client_fstore.has_files():
+            sys.exit("IPA client is already configured on this system.\n"
+                     + "Please uninstall it first before configuring the IPA server.")
+
     logging.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
     logging.debug("missing options might be asked for interactively later\n")
 
-- 
1.7.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to