Bug 1413873 - [RFE] Keep DNF cache mounted.
Summary: [RFE] Keep DNF cache mounted.
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Copr Team
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2017-01-17 08:25 UTC by Vít Ondruch
Modified: 2020-03-17 04:43 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Last Closed:
Type: Bug

Attachments (Terms of Use)

Description Vít Ondruch 2017-01-17 08:25:26 UTC
Description of problem:
I am using LVM root. Once the build is finished, the root is kept mounted. But surprisingly, the DNF cache is unmounted:

Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.yB21KM
+ umask 022
+ cd /builddir/build/BUILD
+ cd rubygem-hpricot-0.8.6
+ /usr/bin/rm -rf /builddir/build/BUILDROOT/rubygem-hpricot-0.8.6-13.fc26.x86_64
+ exit 0
DEBUG: Child return code was: 0
DEBUG: Copying packages to result dir
Finish: rpmbuild rubygem-hpricot-0.8.6-13.fc26.src.rpm
Finish: build phase for rubygem-hpricot-0.8.6-13.fc26.src.rpm
INFO: Done(rubygem-hpricot-0.8.6-13.fc26.src.rpm) Config(fedora-rawhide-x86_64) 0 minutes 33 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-rawhide-x86_64/result
Finish: run
DEBUG: kill orphans
DEBUG: child environment: None
DEBUG: Executing command: ['/bin/umount', '-n', '/var/lib/mock/fedora-rawhide-x86_64/root/var/cache/dnf/'] with env {'TERM': 'vt100', 'SHELL': '/bin/sh', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'LANG': 'C.UTF-8'} and shell False
DEBUG: Child return code was: 0

This is unexpected. All the root is keep mounted, why not the DNF cache?

Version-Release number of selected component (if applicable):
$ rpm -q mock

How reproducible:

Steps to Reproduce:

Actual results:
DNF cache is unmounted at the end of build.

Expected results:
DNF cache is kept mounted similarly to the rest of the build root.

Additional info:
This is my mock configuration:

$ cat ~/.config/mock.cfg 
# By default Mock use simple chroot(1). When you set this to True
# it will use systemd-nspawn(1)
config_opts['use_nspawn'] = True
# If you're using nspawn, then by default networking will be turned off
# for rpmbuild.  This helps ensure more reproducible builds.
config_opts['rpmbuild_networking'] = True

# You can configure Yum, DNF, rpm and rpmbuild executable paths if you need to
# use different versions that the system-wide ones
config_opts['yum_command'] = '/usr/bin/yum-deprecated'

# if you want to speed up the package installation and the build process, mock
# can use nosync library to skip fsync and related calls from programs called
# from within mock. It needs nosync library to be installed and for multilib
# target, it requires both architectures of nosync to be present. If these
# conditions aren't met, it won't be enabled
config_opts['nosync'] = True

#config_opts['plugin_conf']['root_cache_enable'] = False

# lvm_root plugin is not enabled by default and is distributed in separate
# subpackage mock-lvm. If you want to use it, it's recommended to disable the
# root_cache plugin, otherwise you'd be caching twice.
config_opts['plugin_conf']['lvm_root_enable'] = True
# config_opts['plugin_conf']['lvm_root_opts'] = {}
# You need to give it a volume group with sufficient space. It won't touch any
# of the existing logical volumes, so you can use the same volume group you use
# for other purposes. It requires a name of the VG (not device path).
# config_opts['plugin_conf']['lvm_root_opts']['volume_group'] = 'my_vg'
# You need to specify the size that will mock's thinpool occupy. For regular
# packages with small set of dependencies, 2G should suffice. For large packages
# such as libreoffice, you should set it to at least 5 GB otherwise you may run
# out of space and the build process will be blocked
# config_opts['plugin_conf']['lvm_root_opts']['size'] = '2G'
# You can specify alternative pool metadata size, format is the same as size.
# Default value is determined by lvcreate based on size
# config_opts['plugin_conf']['lvm_root_opts']['poolmetadatasize'] = None
# When thin pool utilization is over 90% mock will refuse to continue.
# Because once it reach 100% utilization weird things will happens.
# config_opts['plugin_conf']['lvm_root_opts']['check_size'] = True
config_opts['plugin_conf']['lvm_root_opts'] = {
    'volume_group': 'vg_fedora',
    'size': '20G',
    'pool_name': 'mock',

Comment 1 Fedora Admin XMLRPC Client 2020-03-17 04:43:02 UTC
This package has changed maintainer in the Fedora.
Reassigning to the new maintainer of this component.

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