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

Patch attached.
From 416ce2c0ab50f80d5d976dfa6a2b9a12975e15fb Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Tue, 1 Mar 2016 18:56:28 +0100
Subject: [PATCH] SPEC: do not run upgrade when ipa server is not installed

Running upgrade when IPA is not installed produces false positive errors

https://fedorahosted.org/freeipa/ticket/5704
---
 freeipa.spec.in | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 2ec7fab88d658111d210b0368d9076917e4a98bf..fbe50becb017e897ea230cc3f68515d39fba7e6f 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -875,15 +875,18 @@ fi
 
 
 %posttrans server
-# This must be run in posttrans so that updates from previous
-# execution that may no longer be shipped are not applied.
-/usr/sbin/ipa-server-upgrade --quiet >/dev/null || :
-
-# Restart IPA processes. This must be also run in postrans so that plugins
-# and software is in consistent state
+# don't execute upgrade and restart of IPA when server is not installed
 python2 -c "import sys; from ipaserver.install import installutils; sys.exit(0 if installutils.is_ipa_configured() else 1);" > /dev/null 2>&1
-# NOTE: systemd specific section
+
 if [  $? -eq 0 ]; then
+    # This must be run in posttrans so that updates from previous
+    # execution that may no longer be shipped are not applied.
+    /usr/sbin/ipa-server-upgrade --quiet >/dev/null || :
+
+    # Restart IPA processes. This must be also run in postrans so that plugins
+    # and software is in consistent state
+    # NOTE: systemd specific section
+
     /bin/systemctl is-enabled ipa.service >/dev/null 2>&1
     if [  $? -eq 0 ]; then
         /bin/systemctl restart ipa.service >/dev/null 2>&1 || :
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to