Bug 212681 - %pre scripts fail if /var/tmp is missing (rpm --root)
Summary: %pre scripts fail if /var/tmp is missing (rpm --root)
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm
Version: 3.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2006-10-27 23:50 UTC by Aaron Hanson
Modified: 2007-11-30 22:07 UTC (History)
0 users

Clone Of:
Last Closed: 2007-10-19 18:40:16 UTC

Attachments (Terms of Use)

Description Aaron Hanson 2006-10-27 23:50:53 UTC
Description of problem:
Doing a package install to an alternate root, %pre scripts will not run at all
if /var/tmp doesn't exist

Version-Release number of selected component (if applicable):
RPM version 4.2.3

How reproducible:

Steps to Reproduce:
1.make a trivial package with a %pre script
2.initialize an alternate root area:
  a. (rpm --initdb ...)
  b. get /bin/sh working in the chroot
3.install the package to the alternate root (rpm -i --root ...)
Actual results:
%pre scripts always fail, like this:
error:   install: %pre scriptlet failed (2), skipping ...

Additional info:
add step 2.c: mkdir /var/tmp in the chroot area; then the pre script will run...
per Jeff Johnson:
> Hmmm, I'm pretty sure that I added a lazy mkdir on /var/tmp the 14th 
> or 15th time I had to diagnose this problem years ago.

Comment 1 Jeff Johnson 2007-04-11 01:44:13 UTC
Yes, here's the lazy mkdir when creating temporary files in order to run scriptlets:

    /* Create the temp directory if it doesn't already exist. */
    if (!_initialized) {
        _initialized = 1;
        tempfn = rpmGenPath(prefix, tpmacro, NULL);
        if (rpmioMkpath(tempfn, 0755, (uid_t) -1, (gid_t) -1))
            goto errxit;

%pre scripts are run in lib/psm.c, with the scritlet written to a temp file created by makeTempFile().


Comment 2 RHEL Product and Program Management 2007-10-19 18:40:16 UTC
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
For more information of the RHEL errata support policy, please visit:
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

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