diff options
author | Martin Basti <mbasti@redhat.com> | 2016-03-01 18:56:28 +0100 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-03-22 10:28:16 +0100 |
commit | 4f25b296054076abf3d6e44f6b2e7552f993fb1c (patch) | |
tree | bfccab23a097a9b0f44d73926839b2c8515ed4bb /freeipa.spec.in | |
parent | 4a396dd68b1bc6cc68765f502f7e952a087064a8 (diff) | |
download | freeipa-4f25b296054076abf3d6e44f6b2e7552f993fb1c.tar.gz freeipa-4f25b296054076abf3d6e44f6b2e7552f993fb1c.tar.xz freeipa-4f25b296054076abf3d6e44f6b2e7552f993fb1c.zip |
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
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Diffstat (limited to 'freeipa.spec.in')
-rw-r--r-- | freeipa.spec.in | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/freeipa.spec.in b/freeipa.spec.in index 51bd5a56c..b7c1c2424 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -877,15 +877,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 || : |