Bug 340531 - mock can blow away /dev
mock can blow away /dev
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
rawhide
All Linux
urgent Severity urgent
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
:
Depends On:
Blocks: fedora-ia64
  Show dependency treegraph
 
Reported: 2007-10-19 16:55 EDT by Doug Chapman
Modified: 2013-01-09 20:42 EST (History)
2 users (show)

See Also:
Fixed In Version: 0.8.4-2.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-29 15:05:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to umount /dev during initial clean (558 bytes, patch)
2007-10-19 18:23 EDT, Doug Chapman
no flags Details | Diff

  None (edit)
Description Doug Chapman 2007-10-19 16:55:05 EDT
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 17:59:54 EDT
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 18:23:32 EDT
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 19:07:55 EDT
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 03:06:20 EDT
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 15:05:34 EDT
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 11:12:05 EST
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 01:01:43 EST
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 09:20:54 EST
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 11:06:30 EST
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 12:48:41 EST
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?

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