Description of problem: mock doesn't umount /dev and /proc filesystems from buildroots in case of crititcal errors such as "No space left on device". As a consequence it will delete the /dev filesystem in the next mock run since it tries to delete all contents of previous buildroot. Version-Release number of selected component (if applicable): mock-0.7.4-1.fc7 How reproducible: Build a srpm with mock on a filesystem which doesn't have enough free space. Steps to Reproduce: 1. mock <srpm> 2. wait for "No space left on device." 3. mock <srpm> 4. /dev filesystem is deleted Actual results: /dev is gone. Expected results: /dev isn't gone. Additional info: Likely affects rawide mock as well.
I think this happens when you run mock build while being in mock shell as well. I just experienced it on EL5 with fc6 mock rpm -- so if you fix it, please update this as well.
Created attachment 216311 [details] Patch to umount '/dev' during clean()
As the patch above explains, '/dev' is never umounted in the 'def clean()' method. Therefore, if '/dev' was never umounted in a previous build, the next one would rm -rf it. Testing with the patch above applied avoid '/dev' from being wiped out.
fixed in mock 0.8.0+
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'
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.
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'
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.
Fedora 6 is affected by this, too. $ rpm -q mock mock-0.7.2-1.fc6.1
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.
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?
Doesn't work. (I've got mock-0.7.7 from http://linux.dell.com/git/mock.git too). As I see it, this clean() function is called pretty much at the beginning, even before prep(). It simply cannot work when --uniqueext is set, which is the case with a buildsys like Plague.
"plague-client kill ..." makes it worse, it seems, as I see multiple mock/mock-yum related processes here still after the "mock clean".
For manual mock builds it works. In Plague I've modified the kill handler to wait for the mock process group and not just for the mock child before running mock clean. I find it strange that it kills the mock process group, but waits for just the child. So far, waiting for the entire group works for me fine.
Ah! Found the remaining problem: $ /usr/bin/setarch i686 /usr/bin/mock clean --uniqueext=e6132b04344468297335b1f64f8530c0065a584f -r fedora-8-i386-build Could not create dir /var/lib/mock/fedora-8-i386-e6132b04344468297335b1f64f8530c0065a584f/state. Error: [Errno 28] No space left on device: '/var/lib/mock/fedora-8-i386-e6132b04344468297335b1f64f8530c0065a584f/state' So, in Jindrich's original bug report, in the out-of-disk-space condition, also a "mock clean" doesn't umount the bind mounts because it terminates too early.
FC6 is locked for updates in early Dec. If you would like to submit patches, I would happily accept them into a 0.7.x update as long as they make the freeze deadline and Jesse and Clark give an ok.
Created attachment 260531 [details] umount early in mock-0.7.7 Here's one way to fix it. In "clean" run-mode, unmount as soon as the config rootdir has been determined.