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

Re: order of trigger script execution



(back from running your test cases)

On Wed, Mar 05, 2003 at 08:10:01PM -0500, Jeff Johnson wrote:
> 
> Mostly correct, but you're missing something I believe.
> 
> rpm-4.1 includes erased package dependencies when ordering upgrades.
> 
> Previous versions of rpm had the associated erased package on upgrade
> immediately after the incoming to-be-installed package.
> 
> It turns out that erased packages almost always have no important
> dependencies, and hence always end up at the end of the transaction,
> rather than immediately following.
> 
> So, with all erased packages at the end of a transaction, that changes
> the absolute (but not the relative) position when triggers fire, i.e.
> other scriptlets will be run between the incoming install and the
> outgoing erasure.
> 
> Having all the erasures at the end of a transaction is A Good Thing, as
> all those erasure can/will be run in parallel.

Or maybe I'm missing something. :-)

Here's debugging output from doing
	rpm -Uvv test4a-2*.rpm

rpm-4.2, rpm-4.1 has same behavior afaik.

...
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D:     0    0    0    1    0 -test4a-1.0-1
D: ========== successors only (0 bytes)
D:     1    0    0    0    0 +test4a-2.0-1

--> Hmmm, I expected +test4a-2.0-1 before -test4a-1.0-1. That's not
necessarily fatal or even unusual, as adding --force to reinstall
an already installed package orders in this fashion.

...
D: ========== +++ test4a-2.0-1

--> Odd, test4a-2.0-1 is installed before remove. I'll need to dig deeper
to figure out why this is.

==> "new-%pre"
D:   install: %pre(test4a-2.0-1) synchronous scriptlet start
D:   install: %pre(test4a-2.0-1)        execv(/bin/sh) pid 23728
+ echo SCRIPT test4a-2 pre install
SCRIPT test4a-2 pre install
D:   install: waitpid(23728) rc 23728 status 0
test4a-2.0-1
...

==> "new-%post"
D:   install: %post(test4a-2.0-1) synchronous scriptlet start
D:   install: %post(test4a-2.0-1)       execv(/bin/sh) pid 23729
+ echo SCRIPT test4a-2 post install
SCRIPT test4a-2 post install
D:   install: waitpid(23729) rc 23729 status 0

==> "any-%triggerin"
D:  read h#     959 Header SHA1 digest: OK (10ffd7fe4ae22d008eda57732f443db4a125a559)
D:   install: %post(test4c-1.0-1) synchronous scriptlet start
D:   install: %trigger(test4c-1.0-1)    execv(/bin/sh) pid 23730
+ echo SCRIPT test4c triggerin: trigger=test4a 1.0-1
SCRIPT test4c triggerin: trigger=test4a 1.0-1
D:   install: waitpid(23730) rc 23730 status 0

==> "new-%triggerin"
D:  read h#     958 Header SHA1 digest: OK (d054f2bb2b219569fc9330d0641c677614fcd025)  
D:   install: %post(test4a-2.0-1) synchronous scriptlet start
D:   install: %trigger(test4a-2.0-1)    execv(/bin/sh) pid 23731
+ echo SCRIPT test4a-2 triggerin: trigger=test4b
SCRIPT test4a-2 triggerin: trigger=test4b
D:   install: waitpid(23731) rc 23731 status 0

D: ========== --- test4a-1.0-1

--> So your discrepancy is the order of the the next 2 scriptlets.

==> should be "old-%triggerun", is actually "any-%triggerun"
D:     erase: test4a-1.0-1 has 0 files, test = 0
D:     erase: %preun(test4c-1.0-1) asynchronous scriptlet start
D:     erase: %trigger(test4c-1.0-1)    execv(/bin/sh) pid 23732
+ echo SCRIPT test4c triggerun: trigger=test4a 1.0-1
SCRIPT test4c triggerun: trigger=test4a 1.0-1
D:     erase: waitpid(23732) rc 23732 status 0

==> should be "any-%triggerun", is actually "old-%triggerun"
D:     erase: %preun(test4a-1.0-1) asynchronous scriptlet start
D:     erase: %trigger(test4a-1.0-1)    execv(/bin/sh) pid 23733
+ echo SCRIPT test4a-1 triggerun: trigger=test4b
SCRIPT test4a-1 triggerun: trigger=test4b
D:     erase: waitpid(23733) rc 23733 status 0

==> "old-%preun"
D:     erase: %preun(test4a-1.0-1) asynchronous scriptlet start
D:     erase: %preun(test4a-1.0-1)      execv(/bin/sh) pid 23734
+ echo SCRIPT test4a-1 pre uninstall
SCRIPT test4a-1 pre uninstall
D:     erase: waitpid(23734) rc 23734 status 0 

==> "old-%postun"
D:     erase: %postun(test4a-1.0-1) asynchronous scriptlet start
D:     erase: %postun(test4a-1.0-1)     execv(/bin/sh) pid 23735
+ echo SCRIPT test4a-1 post uninstall
SCRIPT test4a-1 post uninstall
D:     erase: waitpid(23735) rc 23735 status 0

==> "old-%triggerpostun"
	(the test4a-1.0 %triggerun was not fired because test4b was not erased)

==> "any-%triggerpostun"
D:     erase: %postun(test4c-1.0-1) asynchronous scriptlet start
D:     erase: %trigger(test4c-1.0-1)    execv(/bin/sh) pid 23736
+ echo SCRIPT test4c triggerpostun: trigger=test4a 1.0-1
SCRIPT test4c triggerpostun: trigger=test4a 1.0-1
D:     erase: waitpid(23736) rc 23736 status 0

============================================================================

I'll see if I can figger answers to the discrepancies.

Inquiring minds want to know, however:

1) What are you trying to do?

2) Does the reversed "old-%triggerun" and "any-%triggerun" scriptlet
execution matter?

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj@redhat.com (jbj@jbj.org)
Chapel Hill, NC





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