This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 526414 - missing /dev/fd symlink causes some mock builds using it to fail
missing /dev/fd symlink causes some mock builds using it to fail
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
13
All Linux
low Severity high
: ---
: ---
Assigned To: Clark Williams
Fedora Extras Quality Assurance
: Reopened
: 453583 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-30 03:21 EDT by Tuomo Soini
Modified: 2013-01-10 00:30 EST (History)
7 users (show)

See Also:
Fixed In Version: mock-1.1.10-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-09-23 00:57:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Proposed patch for problem (833 bytes, patch)
2009-09-30 03:21 EDT, Tuomo Soini
no flags Details | Diff
Proposed patch for problem with enhanced comment (860 bytes, patch)
2009-09-30 03:28 EDT, Tuomo Soini
no flags Details | Diff

  None (edit)
Description Tuomo Soini 2009-09-30 03:21:48 EDT
Created attachment 363137 [details]
Proposed patch for problem

Description of problem:

missing /dev/fd symlink causes some mock builds relying on it to fail

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

mock 0.9.17.

How reproducible:

Always with packages needing /dev/fd/self or other specific file handle.

Steps to Reproduce:
1. try to rebuild package in mock, build may be successful (some fail)
2. Check build logs for: '/dev/fd' or 'Broken pipe'
3. You'll find errors like these caused by missing /dev/fd symlink

join: /dev/fd/63: No such file or directory
sort: write failed: standard output: Broken pipe
sort: fflush failed: standard output: Broken pipe
zcat: stdout: Broken pipe
cat: write error: Broken pipe
/usr/bin/libtool: line 836: echo: write error: Broken pipe
|/usr/bin/libtool: line 836: echo: write error: Broken pipe
yes: standard output: Broken pipe
sort: fflush failed: standard output: Broken pipe
tr: write error: Broken pipe
sort: write failed: standard output: Broken pipe

Actual results:

Failed or broken builds.

Expected results:

Successful builds.
Comment 1 Tuomo Soini 2009-09-30 03:28:16 EDT
Created attachment 363138 [details]
Proposed patch for problem with enhanced comment

Add missing /dev/fd symlink. Missing symlink causes problems
with fd handling during build causing failed builds.
Comment 2 Bug Zapper 2009-11-16 08:06:55 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 3 Clark Williams 2010-07-16 10:00:24 EDT
for some reason I thought we had this and dropped it, but I can't find why we did so. I'll add it and run it through the test suite, since it looks reasonable.
Comment 4 Clark Williams 2010-07-16 13:31:15 EDT
commit 0dbb10e278c2121b3d6dd8385974c3f777a8ef03
Author: Clark Williams <williams@redhat.com>
Added for mock-1.1.2

Date:   Fri Jul 16 09:42:21 2010 -0500

    added symlink from /proc/self/fd to /dev/fd in the chroot (BZ# 526414)
    
    Added a symlink in the chroot from /proc/self/fd to /dev/fd. Only
    do this for EPEL5+ and FC hosts since the 2.6.9 kernel for EPEL4
    does not support this.
    
    Signed-off-by: Clark Williams <williams@redhat.com>

diff --git a/py/mock/backend.py b/py/mock/backend.py
index f8cb412..f22ac12 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -359,6 +359,10 @@ class Root(object):
         os.symlink("/proc/self/fd/1", self.makeChrootPath("dev/stdout"))
         os.symlink("/proc/self/fd/2", self.makeChrootPath("dev/stderr"))
 
+        # don't symlink for RHEL4 systems
+        if kver > '2.6.9':
+            os.symlink("/proc/self/fd",   self.makeChrootPath("dev/fd"))
+
         # symlink it for FC hosts
         if kver >= '2.6.19':
             os.symlink("/dev/pts/ptmx", self.makeChrootPath("dev/ptmx"))
Comment 5 Clark Williams 2010-07-27 15:29:50 EDT
*** Bug 453583 has been marked as a duplicate of this bug. ***
Comment 6 Fedora Update System 2010-08-03 18:24:36 EDT
mock-1.1.3-1.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/mock-1.1.3-1.fc14
Comment 7 Fedora Update System 2010-08-03 18:25:29 EDT
mock-1.1.3-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/mock-1.1.3-1.fc13
Comment 8 Fedora Update System 2010-08-03 18:28:29 EDT
mock-1.0.10-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/mock-1.0.10-1.el5
Comment 9 Fedora Update System 2010-08-03 18:29:33 EDT
mock-1.0.10-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mock-1.0.10-1.fc12
Comment 10 Fedora Update System 2010-08-04 19:04:04 EDT
mock-1.0.10-1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.0.10-1.el5
Comment 11 Fedora Update System 2010-08-05 10:21:52 EDT
mock-1.1.3-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.1.3-1.fc14
Comment 12 Fedora Update System 2010-08-05 19:35:34 EDT
mock-1.1.3-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.1.3-1.fc13
Comment 13 Fedora Update System 2010-08-05 19:37:06 EDT
mock-1.0.10-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.0.10-1.fc12
Comment 14 Fedora Update System 2010-08-07 19:23:08 EDT
mock-1.1.3-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 15 Jack Neely 2010-08-13 16:45:33 EDT
This patch does not work.  /dev/fd is not symlinked in on my Fedora 13 system running mock-1.1.3-1.fc13.

I've verified that the patch above is present, and it is.  However, we are comparing STRINGS not version numbers.

Python 2.6.4 (r264:75706, Jun  4 2010, 18:20:31) 
[GCC 4.4.4 20100503 (Red Hat 4.4.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> kver = os.uname()[2]
>>> kver
'2.6.33.6-147.fc13.x86_64'
>>> kver > '2.6.9'
False
>>> kver >= '2.6.19'
True

'2.6.33.6-147.fc13.x86_64' is NOT greater than '2.6.9' and the symlink does not get instaleld.
Comment 16 Clark Williams 2010-08-13 17:44:20 EDT
Ugh. Good catch. 

Maybe there's an rpmlib routine exported to python that I can use to do a more thorough comparison. I really don't want to try and write my own RPM NVR comparison routine...
Comment 17 manuel wolfshant 2010-08-13 19:42:09 EDT
Just do an "import rpm" and you'll have the same abilities as /usr/bin/rpmdev-vercmp does :)
Comment 18 Fedora Update System 2010-08-19 13:21:16 EDT
mock-1.1.4-1.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/mock-1.1.4-1.fc14
Comment 19 Fedora Update System 2010-08-19 13:22:22 EDT
mock-1.1.4-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/mock-1.1.4-1.fc13
Comment 20 Fedora Update System 2010-08-19 13:33:08 EDT
mock-1.0.11-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mock-1.0.11-1.fc12
Comment 21 Fedora Update System 2010-08-19 13:34:28 EDT
mock-1.0.11-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/mock-1.0.11-1.el5
Comment 22 Fedora Update System 2010-08-19 18:00:28 EDT
mock-1.0.11-1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/mock-1.0.11-1.el5
Comment 23 Fedora Update System 2010-08-23 17:57:53 EDT
mock-1.1.4-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 24 Fedora Update System 2010-08-23 21:28:34 EDT
mock-1.1.4-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 25 Fedora Update System 2010-08-25 21:03:18 EDT
mock-1.0.11-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 26 Jack Neely 2010-09-02 17:44:08 EDT
Back around to looking at kABI kernel module packages.  Using mock-1.1.4-1.fc13 I still don't have any success with /dev/fd being present in the chroot.

In fact I still see at line 372 in backend.py the buggy code:

        # don't symlink for RHEL4 systems
        if kver > '2.6.9':
            os.symlink("/proc/self/fd",   self.makeChrootPath("dev/fd"))

On my Fedora 13 build host I'm testing by running mock <options> init.  Then mock <options> shell.  Finally ls /dev/fd.
Comment 27 Richard W.M. Jones 2010-09-16 06:34:16 EDT
Koji (F14) also lacks /dev/fd -> /proc/self/fd.

http://git.fedorahosted.org/git/?p=mock.git;a=blob;f=py/mock/backend.py;h=c7d0ca9c4bb1a6f05608049151ac657379eb7e3f;hb=HEAD#l371

 371         # don't symlink for RHEL4 systems
 372         if kver > '2.6.9':
 373             os.symlink("/proc/self/fd",   self.makeChrootPath("dev/fd"))

That test must surely be wrong.  It should be kver <= '2.6.9' if the
comment is to be believed.

This bug has been opened for 2 years, can we fix it now please.
Comment 28 Richard W.M. Jones 2010-09-16 06:35:25 EDT
OK, I'm an idiot, but can we make the link unconditionally, because that
test is failing to create the symlink.
Comment 29 Clark Williams 2010-09-16 11:51:36 EDT
The biggest problem with that comparison is that it doesn't work, since it's a string comparison and 2.6.9 is > 2.6.33. I created a utility function called cmpKernelEVR() which uses the rpmutils function compareEVR(). It's in the queue so I'll try and push it out this week.
Comment 30 Fedora Update System 2010-09-20 10:35:20 EDT
mock-1.1.5-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.5-1.fc14
Comment 31 Fedora Update System 2010-09-20 10:35:39 EDT
mock-1.1.5-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.5-1.fc13
Comment 32 Fedora Update System 2010-09-20 10:42:38 EDT
mock-1.0.12-1.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/mock-1.0.12-1.fc12
Comment 33 Fedora Update System 2010-09-20 10:44:12 EDT
mock-1.0.12-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.12-1.el5
Comment 34 Fedora Update System 2010-09-20 13:53:25 EDT
mock-1.0.12-1.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mock'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/mock-1.0.12-1.el5
Comment 35 Fedora Update System 2010-09-23 00:56:59 EDT
mock-1.1.5-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 36 Fedora Update System 2010-09-30 02:17:06 EDT
mock-1.1.5-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 37 Fedora Update System 2010-10-20 11:44:22 EDT
mock-1.0.13-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.13-1.el5
Comment 38 Fedora Update System 2010-10-20 11:46:44 EDT
mock-1.0.13-1.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/mock-1.0.13-1.fc12
Comment 39 Fedora Update System 2010-12-14 11:14:34 EST
mock-1.0.14-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.14-1.el5
Comment 40 Fedora Update System 2011-01-18 15:04:46 EST
mock-1.0.15-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.15-1.el5
Comment 41 Fedora Update System 2011-02-19 21:26:57 EST
mock-1.1.9-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc13
Comment 42 Fedora Update System 2011-02-19 21:30:00 EST
mock-1.0.16-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.16-1.el5
Comment 43 Fedora Update System 2011-02-19 21:32:52 EST
mock-1.1.9-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.el6
Comment 44 Fedora Update System 2011-02-19 21:35:44 EST
mock-1.1.9-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.9-1.fc14
Comment 45 Fedora Update System 2011-03-03 03:25:40 EST
mock-1.1.9-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 46 Fedora Update System 2011-03-03 03:34:23 EST
mock-1.1.9-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 47 Fedora Update System 2011-05-13 16:34:43 EDT
mock-1.1.10-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc15
Comment 48 Fedora Update System 2011-05-13 16:39:14 EDT
mock-1.1.10-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc14
Comment 49 Fedora Update System 2011-05-13 16:43:30 EDT
mock-1.0.17-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/mock-1.0.17-1.el5
Comment 50 Fedora Update System 2011-05-13 16:47:48 EDT
mock-1.1.10-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.fc13
Comment 51 Fedora Update System 2011-05-13 16:52:08 EDT
mock-1.1.10-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.10-1.el6
Comment 52 Fedora Update System 2011-05-19 00:36:05 EDT
mock-1.1.10-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 53 Fedora Update System 2011-05-24 22:43:25 EDT
mock-1.1.10-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 54 Fedora Update System 2011-05-24 23:17:41 EDT
mock-1.1.10-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 55 Fedora Update System 2011-06-02 15:07:33 EDT
mock-1.0.17-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 56 Fedora Update System 2011-06-02 15:17:26 EDT
mock-1.1.10-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

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