Bug 1432319

Summary: [RFE] Configuration option so that normal users can use the root yum cache in "/var/cache/yum"
Product: Red Hat Enterprise Linux 7 Reporter: Supreet <srandhaw>
Component: yumAssignee: Michal Domonkos <mdomonko>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: medium Docs Contact: Lucie Vařáková <lmanasko>
Priority: medium    
Version: 7.3CC: emrakova, james.antill, klaas, mdomonko, swadeley, vmukhame
Target Milestone: rcKeywords: FutureFeature
Target Release: 7.4   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.4.3-156.el7 Doc Type: Release Note
Doc Text:
*yum* can disable creation of per-user cache as a non-root user New "usercache" option has been added to the `yum.conf(5)` configuration file of the *yum* utility. It allows the users to disable the creation of per-user cache when *yum* runs as a non-root user. The reason for this change is that in some cases users do not want to create and populate per-user cache, for example in cases where the space in the `$TMPDIR` directory is consumed by the user cache data.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 15:05:56 UTC Type: Bug
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: 1420851, 1465896, 1466368    

Description Supreet 2017-03-15 06:19:05 UTC
Description of problem:

The issue is where my /var/tmp partition gets filled up by users running yum search/list/whatever. 
Every user running yum get his own complete cache instead of using the system wide cache.It seems there is no configuration fix for this problem. This behavior leads to yum being unusable if /var/tmp is full.

So enhancement request is to have a configuration option so that all users use the root yum cache in /var/cache/yum

As a workaround is to discourage users from running yum with users other than root.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 7.3 (Maipo)
# rpm -qa|grep yum
yum-plugin-priorities-1.1.31-40.el7.noarch
yum-plugin-versionlock-1.1.31-40.el7.noarch
yum-utils-1.1.31-40.el7.noarch
yum-3.4.3-150.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-rhn-plugin-2.0.1-6.el7.noarch

Actual results:
yum being unusable if /var/tmp is full.

Expected results:
Shouldn't be full

Additional info:
Have a configuration option so that all users use the root yum cache in /var/cache/yum

Comment 6 Karel Srot 2017-07-18 07:19:18 UTC
If we introduce an option to enforce the usage of root's cache for regular users,
would regular users be able to force the metadata download (again) e.g. via --setopt ? IMHO it would be reasonable.

Comment 7 Michal Domonkos 2017-07-18 13:26:26 UTC
(In reply to Karel Srot from comment #6)
> If we introduce an option to enforce the usage of root's cache for regular
> users,
> would regular users be able to force the metadata download (again) e.g. via
> --setopt ? IMHO it would be reasonable.

Good point, I think that's a good reason to make this a config option rather than a cmdline option so that users can override it with --setopt if they wish.  The default will probably stay the same (i.e. preload enabled), so they will be able to enable it again.

Comment 8 Klaas Demter 2017-07-19 07:48:36 UTC
Hi,
I have a question about the proposed possibility to allow a user to force metadata download. Do you want a user to be able to refresh the "global" cache in /var/cache/yum? That shouldn't be possible in yums current form because its not setuid and the cache is not writeable for other users than root.

Or do you simply want to enable them to override the "use root cache" option and fall back to the current behaviour of creating a user owned cache?

Greetings
Klaas

Comment 9 Michal Domonkos 2017-07-19 10:24:49 UTC
(In reply to Klaas Demter from comment #8)
> Hi,
> I have a question about the proposed possibility to allow a user to force
> metadata download. Do you want a user to be able to refresh the "global"
> cache in /var/cache/yum? That shouldn't be possible in yums current form
> because its not setuid and the cache is not writeable for other users than
> root.

Yup, that's correct, see below.

> 
> Or do you simply want to enable them to override the "use root cache" option
> and fall back to the current behaviour of creating a user owned cache?
> 
> Greetings
> Klaas

This.

I imagine the semantics of the new option to be something like "don't preload anything, just use the root cache directly", of which the opposite (and the default) is "preload stuff from the root cache to the user cache".

I'll have to think about it more deeply once I'm at it, though, but it probably will be done along these lines.

Comment 15 Michal Domonkos 2017-10-31 17:22:15 UTC
*** Bug 1500666 has been marked as a duplicate of this bug. ***

Comment 23 errata-xmlrpc 2018-04-10 15:05:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0845