Description of problem: When building a (s)RPM, root cache id built, including files like: /var/log/faillog /var/log/lastlog Those "special files" make tar xf fail when unpacking newly built root_cache file. Version-Release number of selected component (if applicable): mock 1.0.2-1.el5 tar 1.15.1-23.0.1.el5 build machine: rhel5.4 x86_64 How reproducible: mostly (curiously) on monday when people are back to work Steps to Reproduce: * remove root_cache file, * build a RPM with: mock -r rhel-5-x86_64 --buildsrpm --spec=SPECS/<...>.spec --sources=SOURCES/ --resultdir=SRPMS (quite long) * rebuild it (same command line) (quite long) error retrieved: DEBUG util.py:280: Executing command: ['tar', '--use-compress-program', 'gzip', '-xf', '/var/cache/mock/rhel-5-x86-64/root_cache/cache.tar.gz', '-C', '/var/lib/mock/rhel-5-x86-64-<...>/root/'] DEBUG util.py:256: tar: ./var/log/faillog: Wrote only 4096 of 10240 bytes DEBUG util.py:256: tar: Skipping to next header DEBUG util.py:256: tar: ./var/lib/mock/rhel-5-x86-64-<...>/root/var/lib/yum/transaction-all.2010-04-26.16\:10.45: Cannot write: No space left on device DEBUG util.py:319: Child returncode was: 2 Actual results: Expected results: DEBUG util.py:280: Executing command: ['tar', '--use-compress-program', 'gzip', '-xf', '/var/cache/mock/rhel-5-x86-64/root_cache/cache.tar.gz', '-C', '/var/lib/mock/r hel-5-x86-64/root/'] DEBUG util.py:319: Child returncode was: 0 DEBUG util.py:57: ensuring that dir exists: /var/lib/mock/rhel-5-x86-64/root/var/cache/yum Additional info: A dirty workaround we added to let people continue to build the RPMs: in: /usr/lib/python2.4/site-packages/mock/plugins/ [...] .. ["tar"] + self.compressArgs + ["-cf", self.rootCacheFile, ... "-C", self.rootObj.makeChrootPath(), ... "--exclude", ".*var/log/lastlog", ... "--exclude", ".*var/log/faillog", ... "."], .. shell=False
are /var/log/lastlog and /var/log/faillog sparse files? Sounds like we should nuke those files before creating the cache image...
Hi, they are. The trouble is packages actually "can" use those files, so we can nuke them but when untaring files, we might have to re-create them...
Please note that mockobjects is a java testing utility and has nothing to do with this issue. There does not appear to be a mock component selectable for rhel 5 in this bugzilla. Where did you get the mock rpm from?
Hi I don't remember having reported this bug on mockobjects but rather on Fedora/mock. Could you please change the product/component? (I don't have the permissions to do it) Thanks Anyway, here are the information requested: # rpm -qi mock Name : mock Relocations: (not relocatable) Version : 1.0.2 Vendor: Fedora Project Release : 1.el5 Build Date: Wed 23 Dec 2009 11:50:56 PM CET Install Date: Thu 28 Jan 2010 09:21:21 AM CET Build Host: localhost Group : Development/Tools Source RPM: mock-1.0.2-1.el5.src.rpm Size : 0 License: GPLv2+ Signature : DSA/SHA1, Thu 28 Jan 2010 09:16:29 AM CET, Key ID 6de4113d19e1a11f Packager : Fedora Project URL : http://fedoraproject.org/wiki/Projects/Mock Summary : Builds packages inside chroots Description : Mock takes a srpm and builds it in a chroot taken on
reassigning the project back to Fedora epel and setting the correct component.
What about truncating both /var/log/lastlog and /var/log/faillog to empty files before creating the cache?
That might sound like a good idea but truncating (at least) the faillog file on the server would erase all information from pam_tally, which is against our security policies...
Sorry, I meant the files in the chroot, not the actual files on the host system.
Looking at adding the patch below. This will truncate both lastlog and faillog files in the chroot directory, before the cache tarball is created. Make sense? diff --git a/py/mock/plugins/root_cache.py b/py/mock/plugins/root_cache.py index 007627c..6a3ca1a 100644 --- a/py/mock/plugins/root_cache.py +++ b/py/mock/plugins/root_cache.py @@ -106,6 +106,11 @@ class RootCache(object): for tmp in glob(self.rootObj.makeChrootPath('var/lib/rpm/__db*')): os.unlink(tmp) + # truncate the sparse files in /var/log + for logfile in ('/var/log/lastlog', '/var/log/faillog'): + f = open(self.rootObj.makeChrootPath(logfile), "w") + f.truncate(0) + f.close() # never rebuild cache unless it was a clean build. if self.rootObj.chrootWasCleaned:
I just reported this in bug 633435, which can be marked as a duplicate, and in fact submitted the same patch there as here, to exclude those files from the tarball. To the idea of zeroing the files: why bother zeroing and invalidating a file that you can simply exclude?
about your zeroing files, the fact is (tell me if I'm wrong) we can't truncate "root faillog" (but we can truncate the chroot one). Reading the diff, it seems that for the sparse files, you *create* new ones inside the chroot env when creating the root cache? If that's the case then it looks fine :)
yes, the intend is to create empty files in the chroot. That way anyone that depends on their existence will work and we're not paying a huge size penalty for a couple of sparse files. Queue for next release
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
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
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
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
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
Hi, tested, and it seems to work as expected: # tar ztvf cache.tar.gz | egrep "/var/log/(fail|last)log" -rw-r--r-- root/root 0 2010-09-21 12:23:58 ./var/log/lastlog -rw------- root/root 0 2010-09-21 12:23:58 ./var/log/faillog
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.
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.
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
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
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
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
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
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
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
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
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.
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.
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
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
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
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
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
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.
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.
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.
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.
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.