List Info

Thread: How to prevent rpm to upgrade/remove a rpm ?




How to prevent rpm to upgrade/remove a rpm ?
user name
2006-03-06 09:55:22
I've been practising building and managing rpm for a while
now by using 
some good advices of the mandriva community.
But today I'm facing a problem I can't solve and the
preleminary 
discussions I had on #rpm didn't helpt me to find the
solution, that's 
why I've decided this morning to mail the rpm-devel mailing
list.

Usually when you upgrade or remove a rpm on a system, you
use the 
different %pre/%post for managing the start/stop of
your 
services. This works fine. But what about if you're running
in a cluster ?

Imagine an application which is distributed on a cluster and
installed 
using rpm. Then using an admin console, you start a
clustered 
application : that means that all nodes are communicating
and must have 
the same release for insuring a quality service. Everything
is fine.

Now you must make a critical update or a major update
meaning your 
application will not be compatible with the previous
release. The usual 
way to do that will be stopping the application, upgrade it
and then 
restart it. That's the way I do and it works. Cool.

But what about if someone try to upgrade/remove the rpm
while the 
application is running ? This case mustn't appear because
the 
application will fail or will break. In a High Availability 
environnement this is not acceptable. So using the
%pre/%preun for 
starting/stopping the application is not possible because a
node of this 
cluster could not stop the entire application so if we ask
this node to 
upgrade/remove the rpm it must abort.

So I've used a small script in the %pre/%preun to check if
the 
application is running for aborting the upgrade/remove. My
script is 
able to detect if  rpm is allowed or not to do its job. But
I sounds 
like I can't prevent rpm to do it ! Using some exit code in
this 
sections will exit the section but rpm will not abort this
upgrade/remove.

My 2 cents questions is:  Is it possible to prevent rpm for 
upgrading/removing a rpm ?
If not, I think I could be usefull to add this feature to
help the 
clustered application to manage their upgrade/removal.

What do you think about that ?
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
How to prevent rpm to upgrade/remove a rpm ?
user name
2006-03-06 10:42:18
Le Lundi 6 Mars 2006 10:55, Velu Erwan a écrit :
> So I've used a small script in the %pre/%preun to
check if the
> application is running for aborting the upgrade/remove.
My script is
> able to detect if  rpm is allowed or not to do its job.
But I sounds
> like I can't prevent rpm to do it ! Using some exit
code in this
> sections will exit the section but rpm will not abort
this upgrade/remove.

Which version of rpm are using ? And from what which distrib
?

If it is mandriva, know there was a patch in rpm < 4.4
disabling the behaviour 
you described above. I removed this patch myself since
Mandriva Linux 2006 
because it break the standard behaviour and because it
disallow what you're 
trying to do.

>
> My 2 cents questions is:  Is it possible to prevent rpm
for
> upgrading/removing a rpm ?

Normally yes, no in Mandriva Linux < 2006

> If not, I think I could be usefull to add this feature
to help the
> clustered application to manage their upgrade/removal.

It is a standard feature in rpm for a while (except in
mandriva).
On cooker list you'll find many thread about uncheck script
which make 
install/desinstall impossible. Poeple was use to write ugly
scriptlets and 
having rpm checking nothing.  
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
How to prevent rpm to upgrade/remove a rpm ?
user name
2006-03-06 11:57:08
Olivier Thauvin a écrit :

>Which version of rpm are using ? And from what which
distrib ?
>  
>
Hum, I saw this troubles on mandriva using rpm 4.2.3.

>If it is mandriva, know there was a patch in rpm <
4.4 disabling the behaviour 
>you described above. I removed this patch myself since
Mandriva Linux 2006 
>because it break the standard behaviour and because it
disallow what you're 
>trying to do.
>  
>
Yes ! It works fine on my rpm 4.4.2 (mdv 2006).
My test case on my redhat using a 4.2.2 version works also.
For mdv is really buggy for previous release :(

Thx nanar for pointing out this and your fix,
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
How to prevent rpm to upgrade/remove a rpm ?
user name
2006-03-06 12:11:46
Le Lundi 6 Mars 2006 12:57, Velu Erwan a écrit :
> Olivier Thauvin a écrit :
> >Which version of rpm are using ? And from what
which distrib ?
>
> Hum, I saw this troubles on mandriva using rpm 4.2.3.
>
> >If it is mandriva, know there was a patch in rpm
< 4.4 disabling the
> > behaviour you described above. I removed this
patch myself since Mandriva
> > Linux 2006 because it break the standard behaviour
and because it
> > disallow what you're trying to do.
>
> Yes ! It works fine on my rpm 4.4.2 (mdv 2006).
> My test case on my redhat using a 4.2.2 version works
also.
> For mdv is really buggy for previous release :(

I think Mandriva's poeple called this a
"feature". I disable many other patch 
like this one. Like the "multiarch check", a
feature denying to many poeple 
to recompil few rpms.

In your case the patch to remove is called
"rpm-4.0.3-script-dont-fail.patch":

http://cvs.mandriva.com/cgi-bin/
viewcvs.cgi/SPECS/rpm/rpm-4.0.3-script-dont-fail.patch?rev=1
.3&only_with_tag=r4_2_3-9mdk&view=markup
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )