RPM %post and %preun

  • Permalink
  • submit to reddit
  • Email
  • Follow


In an RPM spec file %post gets run after the install of the
binary package is complete.  %preun gets run before the uninstall
procedes.  I have a package which creates a file with %post and
deletes it with %preun.  Whenever I upgrade the package, the
newer package creates the file first.  Then the older package
deletes it.  I would think that the older package being
uninstalled would delete it first, followed by the new package
creating it.  But, it doesn't work this way.

Help?  Thanks....

-- 
Unless otherwise noted, the statements herein reflect my personal
opinions and not those of any organization with which I may be affiliated.
0
Reply nobody3134 (44) 8/21/2003 7:34:50 PM

See related articles to this posting


Kevin wrote:

> In an RPM spec file %post gets run after the install of the
> binary package is complete.  %preun gets run before the uninstall
> procedes.  I have a package which creates a file with %post and
> deletes it with %preun.  Whenever I upgrade the package, the
> newer package creates the file first.  Then the older package
> deletes it.  I would think that the older package being
> uninstalled would delete it first, followed by the new package
> creating it.  But, it doesn't work this way.

the install happens first, then the uninstall.

http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=4225

-- 
------------------------------------------------------------------
  Andrew Schultz                    | The views expressed might
  ajschult@eos.ncsu.edu             | not represent those of NCSU.
  http://www4.ncsu.edu/~ajschult/   | They are however, correct.

0
Reply ajschult (13) 8/21/2003 10:08:17 PM

Kevin wrote:
> In an RPM spec file %post gets run after the install of the
> binary package is complete.  %preun gets run before the uninstall
> procedes.  I have a package which creates a file with %post and
> deletes it with %preun.  Whenever I upgrade the package, the
> newer package creates the file first.  Then the older package
> deletes it.  I would think that the older package being
> uninstalled would delete it first, followed by the new package
> creating it.  But, it doesn't work this way.
> 
> Help?  Thanks....
> 

Andrew is right 'install new, deinstall old'

But you can use the variable $1 to see whether it's a
- first install
- update
- full remove

$1 gives you the number of instance already installed
or was it the number of instance installed after having
executed the rpm command?

Anyway, my CVS host is down and I can't checkout any spec file
for an example.

You can try to play around with

%pre

echo "pre: $1"

%post

echo "post: $1"

%preun

echo "preun: $1"

%postun

echo "postun: $1"

and see what happens.

Toni

0
Reply antonius.erdmann (2) 8/22/2003 12:48:01 PM

Andrew Schultz wrote:
> 
> Kevin wrote:
> 
> > In an RPM spec file %post gets run after the install of the
> > binary package is complete.  %preun gets run before the uninstall
> > procedes.  I have a package which creates a file with %post and
> > deletes it with %preun.  Whenever I upgrade the package, the
> > newer package creates the file first.  Then the older package
> > deletes it.  I would think that the older package being
> > uninstalled would delete it first, followed by the new package
> > creating it.  But, it doesn't work this way.
> 
> the install happens first, then the uninstall.
> 
> http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=4225
> 
> --

Does anyone understand the logic behind this paradigm (install then uninstall)? Everyone I talk to thinks it's backward. 

/dan
0
Reply ganek (9) 9/4/2003 2:19:04 PM

In article <3F5749D8.E2148DF9@attbi.com>, Daniel Ganek wrote:
> Andrew Schultz wrote:
>> 
>> Kevin wrote:
>> 
>> > In an RPM spec file %post gets run after the install of the
>> > binary package is complete.  %preun gets run before the uninstall
>> > procedes.  I have a package which creates a file with %post and
>> > deletes it with %preun.  Whenever I upgrade the package, the
>> > newer package creates the file first.  Then the older package
>> > deletes it.  I would think that the older package being
>> > uninstalled would delete it first, followed by the new package
>> > creating it.  But, it doesn't work this way.
>> 
>> the install happens first, then the uninstall.
>> 
>> http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=4225
>> 
> Does anyone understand the logic behind this paradigm (install then 
> uninstall)? Everyone I talk to thinks it's backward. 

Perhaps the idea is that if the install fails, the previous version is still 
available.

-- 
Dave Brown  Austin, TX
0
Reply dhbrown (306) 9/4/2003 4:32:53 PM

On Thu, 04 Sep 2003 16:32:53 GMT,
    Dave Brown <dhbrown@hobbes.dhbrown.net> wrote:


>In article <3F5749D8.E2148DF9@attbi.com>, Daniel Ganek wrote:
>> Andrew Schultz wrote:
>>> 
>>> Kevin wrote:
>>> 
>>> > In an RPM spec file %post gets run after the install of the
>>> > binary package is complete.  %preun gets run before the uninstall
>>> > procedes.  I have a package which creates a file with %post and
>>> > deletes it with %preun.  Whenever I upgrade the package, the
>>> > newer package creates the file first.  Then the older package
>>> > deletes it.  I would think that the older package being
>>> > uninstalled would delete it first, followed by the new package
>>> > creating it.  But, it doesn't work this way.
>>> 
>>> the install happens first, then the uninstall.
>>> 
>>> http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=4225
>>> 
>> Does anyone understand the logic behind this paradigm (install then 
>> uninstall)? Everyone I talk to thinks it's backward. 
>
>Perhaps the idea is that if the install fails, the previous version is still 
>available.
>

That is too late if the old files have already been replaced by the new ones.
And I do expect that the new files from the package are put in place before
running the %post script.  


Villy
0
Reply vek (278) 9/5/2003 7:57:27 AM

In article <slrnblggf7.8cb.vek@station02.ohout.pharmapartners.nl>, 
Villy Kruse wrote:
> On Thu, 04 Sep 2003 16:32:53 GMT,
>     Dave Brown <dhbrown@hobbes.dhbrown.net> wrote:
> 
>>In article <3F5749D8.E2148DF9@attbi.com>, Daniel Ganek wrote:
>>> Andrew Schultz wrote:
>>>> the install happens first, then the uninstall.
>>>> 
>>> Does anyone understand the logic behind this paradigm (install then 
>>> uninstall)? Everyone I talk to thinks it's backward. 
>>
>>Perhaps the idea is that if the install fails, the previous version is still 
>>available.
>>
> 
> That is too late if the old files have already been replaced by the new ones.
> And I do expect that the new files from the package are put in place before
> running the %post script.  

Too late? Well, that would depend on when the install-fail occurred.  But
consider that if files were already replaced, then it would seem like the
uninstall of the previous version would remove the replacement files.

-- 
Dave Brown  Austin, TX
0
Reply dhbrown (306) 9/5/2003 9:29:38 PM
comp.os.linux.misc 33445 articles. 20 followers. Post

6 Replies
307 Views

Similar Articles

[PageSpeed] 1


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Install an RPM from within the %post section
Running RHEL 4: I have an application that I'm building that, along with the executables and config files, has some rpm's within the package. In the %post section, I look at whether any of those rpm's need to be installed and, if so, I execute an rpm -i which gives me a "waiting for transaction lock" message. I though that, starting in rpm 4.1, the ability to install an rpm from within the %post section was added. If not, what would be the best method to do this. Thanks in advance, Mike mikeshapp@yahoo.com ...

CentOS / ClamAV RPM packages (second post)
Those loving ClamAV anti-virus will appreciate a couple of RPM packages developped for CentOS 5.x. They are designed for sendmail+milter and postfix+amavisd mail serves, but should work fine with other mail servers (to be tested yet). A single RPM package contains all is needed for a working ClamAV installation (other packagings require four or five RPMs). They are freely downloadable from http://www.beacatmail.com/extras.html. Have a look. beacatmail2...@gmail.com ...

post increment not post
I'd like to know why the following program outputs 1, and not 0. #include <iostream> class a { int v; public: a():v(0){} a& operator++(int) { v++; } operator int&() { return v; } }; int main() { a aa; // I intend b to initialize b with 0, then increment a int b = aa++; std::cout << b << std::endl; // didn't happen } Thanks, Robert Robert Swan wrote: > I'd like to know why the following program outputs 1, and not 0. I am surprised it outputs anything. It's not supposed to compile. > > #include...

where to post job postings
Where is the best place to post job opportunities for SAS programmers & statisticians? Thanks, Robert Matthews ...

Why "Welcome Message" I post come get posted as the reply to same post ?
I don't understand, every week I post "Welcome Message" as a new post and it gets posted as reply to my older "Welcome Message", automatically. What exactly is happening ? I have tried both PAN and www.groups.google.com interface but still same problem :( arnuld wrote: > I don't understand, every week I post "Welcome Message" as a new post > and it gets posted as reply to my older "Welcome Message", > automatically. What exactly is happening ? > > I have tried both PAN and www.groups.google.com interface but still > same pr...

post or get message posting
Hi I have a form I need to post to with perl.The form is too big, but here is the key. It has no "type', as it's a message box input. How can I post to it? Thanks. <textarea class="ygta post-input-border" rows="10" cols="60" id="message"name="message" tabindex="3"></textarea> </label> </p> <br/> </td> </tr> <tr> RocketMan <rm@dontspamme.net> wrote: > I have a form I need to post to with perl...

PHP Post, then HTML Post?
Can anyone do this? Using PHP, I want to POST or GET some variables to a second php page. This, I already know how to do. However, on the second php page, I want to use a simple, standard HTML form using the standard form-submitting method such as: <form action="https://orderpage.ic3.com/hop/orderform.jsp" method="post"> whereupon both sets of variables --- the earlier variables that were POSTed or GETted to the second page, along with the standard form variables derived within the second page --- will be POSTed to the above URL. In the second page, might I actua...

Posting through HTTP POST in Applet
hi, i m making an applet which redirects my page to a php page on which i wish to send some information by using HTTP POST; but i faces problem while doing this, the get posted but information dose'nt. code which i use is import javax.swing.*; import java.net.*; import java.io.*; public class MyApplet extends JApplet { public void init() { URL url=null; try{ url=new URL("http://192.168.5.22/java_scan/Mp3Project/server.php"); }catch(MalformedURLException me){} try{ HttpURLConnection connection=(HttpURLConnection)url.openConnection(); connection.setRequestMeth...

rpm wrapper for a non rpm?
Hi All, I am using CentOS 5.4 (Old-Out-Of-Date) as a workstation. I want to install the latest Firefox and Thunderbird binaries from mozilla.com's web site. Somewhere is my past, I remember that there was a wrapper program you could run when you doing such things that kept your rpm database up to date. I remember writing down a note as to how to do it, but now I can not find it. Rats! Anyone remember what this wrapper/thingy is called? Many thanks, -T Todd wrote: > Hi All, > > I am using CentOS 5.4 (Old-Out-Of-Date) as a workstation. > > I wan...

My post dont get posted ?
Why dont my post get posted here ? - P Well I read it;-) I get the impression that the new Newsgroup interface still has 1 or 2 bugs. There has been at least one or two of my posts that I didn't get on this news reader, but were visible on other readers (along with the endless adverts to trainers etc.) so I guess it can't be all that bad. Regards Dave Robinson "Dave Robinson" <dave.robinson@somewhere.biz> wrote in message news:f7n7i0$ohc$1@fred.mathworks.com... > Well I read it;-) > > I get the impression that the new Newsgroup interface still has 1 or ...

Re: where to post job postings
Hi Robert, This listserv is one place to post job opportunities, so long as it's not flooded with such by any one poster. Additionally, many local SAS user groups will post job opportunities local to their geographic areas on their websites. You can get a list of local user groups and their contact information from http://support.sas.com/usergroups. Hope this helps, Nancy Nancy Brucken brucken@provide.net On Mon, 6 Oct 2008 15:18:03 -0700, rsmphotography@GMAIL.COM wrote: >Where is the best place to post job opportunities for SAS programmers >& statisticians? > >Th...

How to create my own RPM from RPM source?
Hi all, I want to create an RPM for CentOS 4.5 from the src rpm's located at http://people.redhat.com/atkac/bind/ Does anyone have a walkthrough or a URL they can point me in the direction of so I can understand how to do this? Thanks in advance. Patrick ...

G-Post post processors
This is a multi-part message in MIME format. ------=_NextPart_000_0024_01C90DF9.E6376E60 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Speaking of what I'm doing or not doing, my boss is complaining that I'm = not spending enough time designing and too much time messing around with = Pro/NC and G-Post, trying to figure out how to do a customized post = processor for a Bridgepost XV-710 with a Fanuc 0m controller. I told him = I'd happily leave it to the guy he hasn't hired yet or he could cough up = some bu...

Apology for Posting a Job Posting
Dear All, I would like to take this opportunity to ask for apology for posting a job posting in this group. i assure you that i will not post any job posting in this group from now on. Regards, Kiran On Jun 18, 8:43 am, Recruiter - Kiran <kiran23...@gmail.com> wrote: > Dear All, > > I would like to take this opportunity to ask for apology for posting a > job posting in this group. > > i assure you that i will not post any job posting in this group from > now on. > > Regards, > Kiran Thank you Kiran. You are an example for other...

Bottom posting (or is it Top Posting)
At last, somebody gets to the point: it's not what you say. it's where you post it! The triumph of small minds over matter! If you perservere, you all could advance to become nit-pickers. This is the alt.form.over.function group, right? We don't want to solve any printer problems until we get it to look like you want it to, right? shaws@aracnet.com wrote: > At last, somebody gets to the point: it's not what you say. it's where > you post it! The triumph of small minds over matter! If you perservere, > you all could advance to become nit-pickers. ...

Apology for Posting a Job Posting
Dear All, I would like to take this opportunity to ask for apology for posting a job posting in this group. i assure you that i will not post any job posting in this group from now on. Regards, Kiran ...

10000 RPM with 15000 RPM
I have 6 15K RPM Ultra3 36.4 gb SCSI disks and 4 10K RPM Ultra3 36.4 gb SCSI disks. I want to make Raid5 for my server. I want to ask if there could be a problem and if there won't be any problem, how will be its performance compared to both 10K RPM and 15K RPM SCSI disks ? Previously ali <aliugur@gmail.com> wrote: > I have 6 15K RPM Ultra3 36.4 gb SCSI disks and 4 10K RPM Ultra3 36.4 > gb SCSI disks. I want to make Raid5 for my server. I want to ask if > there could be a problem and if there won't be any problem, how will > be its performance compared to b...

Re: It's that time again for my quarterly "Where is the CONDIST???" posting. posting. posting.
On 7/28/05, John Santos <john@egh.com> wrote: > Colin Butcher wrote: > > Nothing yet, not even a notification from DSPP EMEA that it's "come out= ". >=20 > Me neither, though at least one of my customers has it. The key might > be that I'm also on DSPP. >=20 > I did get the VAX SPL Q2CY2005. The CD's in it are labeled > VAXBINJUN05x, and dated june 2005. >=20 > Nothing for the Alpha since March. >=20 >=20 > -- > John Santos > Evans Griffiths & Hart, Inc. > 781-861-0670 ext 539 >=20 I got both VAX and Alpha...

RPM
ANY PERSON USE RPM?? B&G wrote: > ANY PERSON USE RPM?? Redhat Package Manager---> Sure ...

post
spamtrap@chron.com ...

Post
You clan will now surely have more to yeap about, won't you... ;) --+-- narayan --+-- On Sat, 05 Nov 2005 19:38:54 +0100, Narayan <narayan1@post.t-com.hr> wrote: >You clan will now surely have more to yeap about, won't you... > >;) Yeappity, yeappity - yuck. --+-- narayan --+-- ...

post
test ...

POST
post= ...

Post
Just my first post testing things out. Robert GIS Programmer Analyst http://www.smartmap.org ...