Description of Problem: Scripts invoked by rpm appear to inherit various file descriptors used by rpm internally (including the file of a package being installed). Example: OpenSSH 3.0.2p2's sshd started from %post after upgrade: [root@kunhuta i386]# /sbin/service sshd status sshd (pid 9106) is running... [root@kunhuta i386]# ls -l /proc/9106/fd/ total 0 lrwx------ 1 root root 64 Feb 6 19:17 0 -> /dev/null lrwx------ 1 root root 64 Feb 6 19:17 1 -> /dev/null lr-x------ 1 root root 64 Feb 6 19:17 11 -> /home/sw/rh/RPMS/i386/openssh-server-3.0.2p1-1loc62.i386.rpm lrwx------ 1 root root 64 Feb 6 19:17 12 -> /dev/pts/1 lrwx------ 1 root root 64 Feb 6 19:17 2 -> /dev/null l-wx------ 1 root root 64 Feb 6 19:17 21 -> /dev/null lrwx------ 1 root root 64 Feb 6 19:17 3 -> socket:[520909] lr-x------ 1 root root 64 Feb 6 19:17 7 -> pipe:[520908] l-wx------ 1 root root 64 Feb 6 19:17 8 -> pipe:[520908] Fds 11 and 12 should not be there. Well, they wouldn't be there if sshd did the right thing (or the wrong thing according to the wise men of OpenBSD) and closed all its unused fds upon startup but you get the point. Version-Release number of selected component (if applicable): rpm-4.0.2-6x How Reproducible: Easily. Steps to Reproduce: 1. cat <<EOF >test.spec Summary: The test package Name: test Version: 1 Release: 1 Group: Test License: public domain Packager: peak %description This is a test. %prep %build %install %post ls -l /proc/$$/fd %files EOF 2. rpmbuild test.spec 3. rpm -i test-1-1.i386.rpm Actual Results: total 0 lr-x------ 1 root root 64 Feb 6 19:37 0 -> pipe:[521125] lrwx------ 1 root root 64 Feb 6 19:37 1 -> /dev/pts/1 lr-x------ 1 root root 64 Feb 6 19:37 11 -> /home/sw/rh/RPMS/i386/test-1-1.i386.rpm lrwx------ 1 root root 64 Feb 6 19:37 12 -> /dev/pts/1 lrwx------ 1 root root 64 Feb 6 19:37 2 -> /dev/pts/1 lr-x------ 1 root root 64 Feb 6 19:37 3 -> /tmp/rpm-tmp.14470 Expected Results: perhaps something like this... total 0 lr-x------ 1 root root 64 Feb 6 19:37 0 -> pipe:[521125] lrwx------ 1 root root 64 Feb 6 19:37 1 -> /dev/pts/1 lrwx------ 1 root root 64 Feb 6 19:37 2 -> /dev/pts/1 lr-x------ 1 root root 64 Feb 6 19:37 3 -> /tmp/rpm-tmp.14470 Additional Information: N/a.
Will be fixed in rpm-4.0.4-0.30 (and rpm-4.0.4 final. Off to openssh to get the daemon repaired as well (sorry Nalin)
While browsing bugs for openssh (!), I have found bugs #18988 (1.5 years old), #27749 (1 year old) describing the same problem. I hope you are going to fix rpm for real this time... ;)
*** This bug has been marked as a duplicate of 61198 ***