Bug 166137 - rpm 4.2 does not close its database properly with --root opt
Summary: rpm 4.2 does not close its database properly with --root opt
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-17 09:22 UTC by Bastien Nocera
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-12-01 10:01:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Test case shell script (317 bytes, text/plain)
2005-11-30 20:22 UTC, Paul Nasrat
no flags Details
Specfile for test case (514 bytes, text/plain)
2005-11-30 20:24 UTC, Paul Nasrat
no flags Details

Description Bastien Nocera 2005-08-17 09:22:17 UTC
The same occurs with rpm 4.2.3-21_nonptl on RHEL3.

+++ This bug was initially created as a clone of Bug #117997 +++

Description of problem:
rpm 4.2 (at least 2004-01-07 cvs snapshot) does not close 
its database properly with --root option. 

Seems that all database files except Packages and Name
are opened after rpm calls chroot(), but the database 
is closing by one (AFAIK) function dbenv->close() 
(called from db_fini()) after rpm leaves "chroot jail". 

How reproducible:
Every time

Steps to Reproduce:
# mv /var/lib/rpm /var/lib/rpm-
# mkdir /tmp/foo
# rpm --root=/tmp/foo --initdb 
# rpm --root=/tmp/foo -i foo.rpm    
rpmdb: /var/lib/rpm/Filemd5s: unable to flush: No such file or directory
rpmdb: /var/lib/rpm/Sha1header: unable to flush: No such file or directory
rpmdb: /var/lib/rpm/Sigmd5: unable to flush: No such file or directory
rpmdb: /var/lib/rpm/Installtid: unable to flush: No such file or directory
rpmdb: /var/lib/rpm/Provideversion: unable to flush: No such file or
directory
rpmdb: /var/lib/rpm/Requireversion: unable to flush: No such file or
directory
rpmdb: /var/lib/rpm/Dirnames: unable to flush: No such file or
directory    
rpmdb: /var/lib/rpm/Triggername: unable to flush: No such file or
directory
rpmdb: /var/lib/rpm/Providename: unable to flush: No such file or
directory
rpmdb: /var/lib/rpm/Requirename: unable to flush: No such file or
directory
rpmdb: /var/lib/rpm/Group: unable to flush: No such file or directory
rpmdb: /var/lib/rpm/Basenames: unable to flush: No such file or directory
error: db4 error(2) from dbenv->close: No such file or directory

Comment 6 Paul Nasrat 2005-11-30 20:22:47 UTC
Created attachment 121653 [details]
Test case shell script

Script to attempt to reproduce

Comment 7 Paul Nasrat 2005-11-30 20:24:27 UTC
Created attachment 121654 [details]
Specfile for test case

Build then place in same dir as test script and run test.sh

Look for messages.

Comment 8 Paul Nasrat 2005-11-30 20:26:11 UTC
The above test case works fine for me (ie no error) on rpm 4.2.3-24_nonptl.

Are people still seeing this with U6?  If so can they ammend the test case
appropriately so I reproduce here.

Comment 9 Bastien Nocera 2005-12-01 10:01:34 UTC
Works with U6, thanks.


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