Description of problem: After having many troubles with rpm hangs, I performed the rpm database "recovery" (http://www.rpm.org/hintskinks/repairdb/), which gave no complaints. (I have been trying to install an Openview Operations agent (has rpms), which was sporadically failing. It uses an install script which basically does about six "rpm -i" commands to install its rpms.) Somehow the database is in some state where any rpm command (that actually reads) will cause it to leave behind the /var/lib/rpm/__db.00* lock files. After this, database reads will work, but write operations will hang. Even operations such as "--rebuilddb" will leave behind the lock files. Queries for non-existant packages will also leave behind the files. Version-Release number of selected component (if applicable): 4.1-1.06 How reproducible: Steps to Reproduce: 1. Get a bad package installation that causes hangs (can be provided) 2. rpm -q anything 3. Note existence of lock files. 4. Delete lock files before you try anything that writes to database... Actual results: # ls /var/lib/rpm/__db.00* -l -rw-r--r--+ 1 root root 8192 Jan 31 10:21 __db.001 -rw-r--r--+ 1 root root 1310720 Jan 31 10:21 __db.002 -rw-r--r--+ 1 root root 360448 Jan 31 10:21 __db.003 Expected results: No lock files present. Additional info: Running base Red Hat 8.0 upgraded from 7.1. rpm version: rpm-4.1-1.06
Note carefully: The __db files are not "lock files" but files that contain locks. The existence of __db files is not your problem, the existence of stale locks is. There are 2 main causes of stale locks. 1) missed SIGCHLD causes rpm-4.1 to "hang" If using rpm-4.1-1.06, upgrade to rpm-4.1-9 packages from ftp://people.redhat.com/jbj/test-4.1, the missed SIGCHLD is fixed there. 2) abnormal termination (e.g. "kill -9") leaves stale locks It's up to the user to do "rm -f /var/lib/rpm/__db*" in this case. A more complete description is in bugzilla, look for the summary rpm-4.1 hangs: READ THIS FIRST