Bug 212681 - %pre scripts fail if /var/tmp is missing (rpm --root)
%pre scripts fail if /var/tmp is missing (rpm --root)
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Panu Matilainen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-27 19:50 EDT by Aaron Hanson
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-19 14:40:16 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 Aaron Hanson 2006-10-27 19:50:53 EDT
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:
consistent

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-10 21:44:13 EDT
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. */
    /*@-branchstate@*/
    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().

WORKSFORME
Comment 2 RHEL Product and Program Management 2007-10-19 14:40:16 EDT
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:
http://www.redhat.com/security/updates/errata/
 
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.