Bug 56521 - RFE: run-once pre/post scripts.
RFE: run-once pre/post scripts.
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-20 10:50 EST by Aleksey Nogin
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-06-07 15:59:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Aleksey Nogin 2001-11-20 10:50:04 EST
Currently, when I upgrade, for example, 6 mozilla packages (mozilla,
mozilla-mail, mozilla-psm, etc), the ldconfig and rebuild-databases.sh will
be ran *twelwe* times (6 %postun scripts and 6 %post scripts). It would be
nice if rpm would have a feature that would allow packagers to specify that
a certain script has to be ran only once per rpm invocation, even if a
bunch of packages reqest it. Obviously, not only mozilla packages would
benefit from it...
Comment 1 Jeff Johnson 2001-11-20 10:57:19 EST
Yup, well understood. In fact, running /sbin/ldconfig in %post
and %postun for each and every package that has a shared
library during an upgrade is more than a bit dumb. I'm willing to
wager that running ldconfig is at least 15% of the wall clock time
of an upgrade. Any takers?

However, since this can't be changed in rpm alone, each and
every package in the distro is gonna need to change, I'm going
to mark this as deferred, as I can't solve the problem in rpm alone.
Comment 2 Aleksey Nogin 2002-05-02 11:24:05 EDT
Yeah, ldconfig is probably the biggest one of all. Especially on upgrade where
all kinds of post and postun scripts call it. I would imagine that solving this
has chances to reduce the upgrade time quite dramatically.

Would the following approach make sense:
- rpm would provide a script /sbin/rpm-run-once such that whenever a package calls
/sbin/rpm-run-once prog args
it would remember it and than run
prog args
at some later point. Of cource, that "some later point" is tricky - if a package
runs something right away (w/o using the rpm-run-once) in a pre script, we need
to make sure all the post scripts for its pre-dependencies have been already
executed.

I guess this means that the post scripts should be ran in batches (delayed until
the first pre script that cares about those). In each batch the first invocation
of "/sbin/rpm-run-once prog args" would just run the "prog args" right away and
then the subsequent calls (with the same prog and args) withing the same batch
would just be ignored.

A cute thing is that we can just start with a dummy implementation -
rpm-run-once would just exec prog args right away. Does not give any advantage
except give people the chance to start converting to new /sbin/rpm-run-once. Can
also be used for legacy rpm versions, once the real thing is there in the new
versions.
Comment 3 Paul Nasrat 2005-06-07 15:59:25 EDT
A specific ldconfig optimisation is available in rpm.

Note You need to log in before you can comment on or make changes to this bug.