Bug 340531

Summary: mock can blow away /dev
Product: [Fedora] Fedora Reporter: Doug Chapman <dchapman>
Component: mockAssignee: David Cantrell <dcantrell>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: urgent    
Version: rawhideCC: bugs.michael, mebrown
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.8.4-2.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-29 19:05:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 163350    
Attachments:
Description Flags
patch to umount /dev during initial clean none

Description Doug Chapman 2007-10-19 20:55:05 UTC
Description of problem:
I am running into this issue on a semi-regular basis in the process of building
Fedora on ia64.

Under certain rpmbuild failure cases mock cleanup will destroy /dev on the build
system.  Note that this is the REAL /dev, not just inside the chroot.

What I believe to be happening is after some rpmbuild failures /dev in the
chroot is busy and the umount fails.  When mock then does it's cleanup I am
guessing it does an rm -rf which would be OK if the chroot /dev was umounted but
since it is a bind mount to the real /dev the files in the systems /dev get trashed.

I am able to recover if I run /sbin/start_udev on the build system but in the
meantime a lot of builds fail, mostly because of the sudden lack of /dev/null.

I have also seen this in some cases where I ^c to stop a mock build.


Version-Release number of selected component (if applicable):
mock-0.7.6-1.fc8

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Doug Chapman 2007-10-19 21:59:54 UTC
I did a little more experimenting with this.  It seems that it is the "clean"
stage that it runs at the beginning of a mock build that is to fault.  If a
previous build did not umount /dev in the chroot env then another build that
uses the same chroot directory will fail because it does an rm -rf while that
old /dev was still mounted.

So, we probably have 2 bugs here.  The /dev not getting properly unmounted on
the previous failed mock build and also the fact that another mock build in the
same directory trashes /dev without realizing it is still mounted from the
previous build.



Comment 2 Doug Chapman 2007-10-19 22:23:32 UTC
Created attachment 233171 [details]
patch to umount /dev during initial clean

Found it, during the clean stage we umount /proc and /dev/pts but not /dev. 
This patch adds that.

Comment 3 Michael E Brown 2007-10-19 23:07:55 UTC
This is actually fixed in a different way in mock 0.8.0. The 0.8.0 tree is at
http://linux.dell.com/git/mock-v2.git and is under review before merging for F9.

I'll merge this patch into the 0.7.x trunk.


Comment 4 Fedora Update System 2007-10-24 07:06:20 UTC
mock-0.8.4-2.fc7 has been pushed to the Fedora 7 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'

Comment 5 Fedora Update System 2007-10-29 19:05:34 UTC
mock-0.8.4-2.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2007-11-06 16:12:05 UTC
mock-0.8.4-2.fc8 has been pushed to the Fedora 8 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'

Comment 7 Fedora Update System 2007-11-08 06:01:43 UTC
mock-0.8.4-2.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Michael Schwendt 2007-11-15 14:20:54 UTC
Fedora 6 is affected by this, too.

$ rpm -q mock
mock-0.7.2-1.fc6.1

Comment 9 Michael E Brown 2007-11-15 16:06:30 UTC
I have tagged mock-0.7.7 in the git repo with fixes for this. Since FC6 is
almost frozen, I had not planned on pushing this update.

If Jesse and Clark agree, we could possibly push it before FC6 freezes completely.

Please test 0.7.7 from git to see that it fixes your issue.

Comment 10 Michael E Brown 2007-11-15 17:48:41 UTC
I have checked 0.7.7 into FC6 tree and run 'make tag', but I have not run a
build yet. Can you please test 0.7.7 before I push it?