Re: How to make RPM installation fail if post script fails ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/2/06, John Runyan <johnrunyan1@xxxxxxxxx> wrote:
How do you stop RPM installation in the %pre section?
It shouldn't require the rollback procedure you sent a
link to, James, should it?
It absolutely does require that.   The reason is  multi-faceted:

  - Pre-scripts can do things.  They do not have the same semanic as a solaris
    verify script which is only used to check for pre-conditions.
  - Pre-scripts are not all ran at the begining of the transaction,
but as each installed
    package goes through  the package state machine (PSM) its
pre-scriplet is ran such
    that the system has necessarily been changes by the packages than
ran before it
    in the transaction.
  - scriptlets are opaque to RPM, so there is no way to tell if a
script has changed the
    system or not.

When you stack these up you get that at the time of a %pre scriptlet
failure the system could have been changed, therefore the transaction
should be rolled back to bring the system back to the original state.
Note, the therefore is based my environments rule of rolling back
failed transactions.  One could have alternate policies.

Also, another thing to consider that my article does not discuss, is
that sometimes an "upgrade" of a system requires multiple transactions
(at least if you are using the rpm cli).   For instance, you might
have one transaction with kernels and kernel modules that were
installed, and then another with other packages that were upgraded.
By the rules in my enviorment if a %pre failed in the second
transaction, then you would want to roll back that transaction and the
previous one.  That is what the --arbgoal switch is about (which is
not documented), which allow you to specify a roll back goal to use in
the event of a failure.

Cheers...james

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux