Re: [Freeipa-devel] [PATCH 0428] SPEC: do not execute upgrade when ipa server is not installed

2016-03-22 Thread Martin Basti



On 18.03.2016 14:12, Martin Babinsky wrote:

On 03/02/2016 07:26 AM, Jan Cholasta wrote:

On 1.3.2016 20:36, Rob Crittenden wrote:

Martin Basti wrote:



On 01.03.2016 20:13, Rob Crittenden wrote:

Martin Basti wrote:

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

Patch attached.


Would it be safer to integrate this into ipa-upgrade itself? You'd 
just

need to return 0 for the case where IPA isn't installed.

rob

How about the case when ipa-server-upgrade is called by user from CLI?
It should fail because IPA is not installed, instead of returning
success. That check is in specfile anyway due service restart.

Martin^2


Yeah, I was hoping you'd miss that :-)

It just seems to me, as you point out, that it should check when run by
anything, user or spec, so adding it only to the spec seems wrong. I'm
not a huge fan of option bloat but that would be one way around this,
--graceful-exit or something. Could make it a hidden option if you
wanted.


I don't think adding the option is worth the effort, as we will be soon
moving away from running the upgrade script directly from the spec file
to a service based solution (#4552, #5373).

I am not a big fan of adding a special option and the related magic to 
the upgrade code itself either.


I will ACK this patch unless there is some strong opposition towards 
this approach.



Pushed to:
master: 4f25b296054076abf3d6e44f6b2e7552f993fb1c
ipa-4-3: 0bd34fa78952b1abefde290f5b3bf7b4a67e73dc

--
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


Re: [Freeipa-devel] [PATCH 0428] SPEC: do not execute upgrade when ipa server is not installed

2016-03-19 Thread Martin Babinsky

On 03/02/2016 07:26 AM, Jan Cholasta wrote:

On 1.3.2016 20:36, Rob Crittenden wrote:

Martin Basti wrote:



On 01.03.2016 20:13, Rob Crittenden wrote:

Martin Basti wrote:

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

Patch attached.



Would it be safer to integrate this into ipa-upgrade itself? You'd just
need to return 0 for the case where IPA isn't installed.

rob

How about the case when ipa-server-upgrade is called by user from CLI?
It should fail because IPA is not installed, instead of returning
success. That check is in specfile anyway due service restart.

Martin^2


Yeah, I was hoping you'd miss that :-)

It just seems to me, as you point out, that it should check when run by
anything, user or spec, so adding it only to the spec seems wrong. I'm
not a huge fan of option bloat but that would be one way around this,
--graceful-exit or something. Could make it a hidden option if you
wanted.


I don't think adding the option is worth the effort, as we will be soon
moving away from running the upgrade script directly from the spec file
to a service based solution (#4552, #5373).

I am not a big fan of adding a special option and the related magic to 
the upgrade code itself either.


I will ACK this patch unless there is some strong opposition towards 
this approach.


--
Martin^3 Babinsky

--
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


Re: [Freeipa-devel] [PATCH 0428] SPEC: do not execute upgrade when ipa server is not installed

2016-03-01 Thread Rob Crittenden
Martin Basti wrote:
> 
> 
> On 01.03.2016 20:13, Rob Crittenden wrote:
>> Martin Basti wrote:
>>> https://fedorahosted.org/freeipa/ticket/5704
>>>
>>> Patch attached.
>>>
>>>
>> Would it be safer to integrate this into ipa-upgrade itself? You'd just
>> need to return 0 for the case where IPA isn't installed.
>>
>> rob
> How about the case when ipa-server-upgrade is called by user from CLI?
> It should fail because IPA is not installed, instead of returning
> success. That check is in specfile anyway due service restart.
> 
> Martin^2

Yeah, I was hoping you'd miss that :-)

It just seems to me, as you point out, that it should check when run by
anything, user or spec, so adding it only to the spec seems wrong. I'm
not a huge fan of option bloat but that would be one way around this,
--graceful-exit or something. Could make it a hidden option if you wanted.

rob

-- 
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


Re: [Freeipa-devel] [PATCH 0428] SPEC: do not execute upgrade when ipa server is not installed

2016-03-01 Thread Rob Crittenden
Martin Basti wrote:
> https://fedorahosted.org/freeipa/ticket/5704
> 
> Patch attached.
> 
> 

Would it be safer to integrate this into ipa-upgrade itself? You'd just
need to return 0 for the case where IPA isn't installed.

rob

-- 
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


[Freeipa-devel] [PATCH 0428] SPEC: do not execute upgrade when ipa server is not installed

2016-03-01 Thread Martin Basti

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

Patch attached.
From 416ce2c0ab50f80d5d976dfa6a2b9a12975e15fb Mon Sep 17 00:00:00 2001
From: Martin Basti 
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