RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1439977 - yum-cron's default random_sleep value excessively delays cron.daily, sometimes breaking logrotate
Summary: yum-cron's default random_sleep value excessively delays cron.daily, sometime...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.3
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-07 01:52 UTC by Gilles Detillieux
Modified: 2019-01-03 12:33 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-03 12:33:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gilles Detillieux 2017-04-07 01:52:01 UTC
Description of problem:
The default delay value for random_sleep is 360 minutes, which means yum-cron can be delayed by up to 6 hours. That is far too long for a job that runs as part of /etc/cron.daily! The /etc/cron.daily/0yum-daily.cron script is one of the first ones run (after 0logwatch), so everything else gets delayed by a random but often excessive amount. If the delay is somewhere around 2-3 hours or more on a Sunday morning, logrotate will run so late that the following Sunday there's a high likelihood that it will conclude that the logs don't need rotating because it hasn't been a full week yet since the last rotation.

A far more reasonable maximum for the random delay would be in the 15-30 minute ballpark.

Version-Release number of selected component (if applicable):
3.4.3-150.el7.noarch

How reproducible:
Because of the random nature, it's hard to reproduce consistently, but if you look at /var/log on a number of RHEL7/CentOS7 systems that have been running for a few months, you're likely to notice gaps in the rotated logs, with some Sunday's results missing or delayed to Monday.

Steps to Reproduce:
1. Ensure that yum-cron and logrotate are installed on your RHEL 7 system.
2. Let stand for a few months.
3. Examine which /var/log/messages-201* files are present and see if any Sunday rotated logs are missing, or possibly delayed by a day.

Actual results:
-on a few of my systems:
/var/log/messages-20170313
/var/log/messages-20170319
/var/log/messages-20170327
/var/log/messages-20170402

-on another:
/var/log/messages-20170312
/var/log/messages-20170320
/var/log/messages-20170326
/var/log/messages-20170402

Expected results:
/var/log/messages-20170312
/var/log/messages-20170319
/var/log/messages-20170326
/var/log/messages-20170402

Additional info:
This is on Scientific Linux 7.3, but it's built from the same sources as RHEL and CentOS, so I expect the same issue is occurring on any EL7 system. After discovering the cause of the problem, which took some time to track down, it was an easy fix to edit /etc/yum/yum-cron.conf and set random_sleep to a saner value, but the default value shouldn't be set to something that breaks things.

Comment 3 Daniel Mach 2019-01-03 12:33:06 UTC
This bug no customer case attached and wasn't proposed for the next minor release.
There is no plan to fix it in RHEL 7.


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