Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1393247 - Skipped first rotation by time after update to logrotate-3.8.6-12.el7.x86_64
Skipped first rotation by time after update to logrotate-3.8.6-12.el7.x86_64
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: logrotate (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity high
: rc
: ---
Assigned To: Kamil Dudka
Robin Hack
: EasyFix, Patch, Regression
: 1393209 (view as bug list)
Depends On:
Blocks: 1298243 1393867 1400961
  Show dependency treegraph
 
Reported: 2016-11-09 03:04 EST by Damir
Modified: 2017-08-01 12:19 EDT (History)
5 users (show)

See Also:
Fixed In Version: logrotate-3.8.6-14.el7
Doc Type: If docs needed, set a value
Doc Text:
NEEDLESS TO DOCUMENT
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 12:19:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1889 normal SHIPPED_LIVE logrotate bug fix and enhancement update 2017-08-01 13:54:32 EDT

  None (edit)
Description Damir 2016-11-09 03:04:07 EST
Description of problem:
Skipped first rotation by time after update to logrotate-3.8.6-12.el7.x86_64 from logrotate-3.8.6-7 or earlier, because /var/lib/logrotate/logrotate.status is empty.

Version-Release number of selected component (if applicable):
logrotate-3.8.6-12.el7.x86_64

How reproducible:
update to logrotate-3.8.6-12.el7.x86_64 from logrotate-3.8.6-7 or earlier

Steps to Reproduce:
1.update to logrotate-3.8.6-12.el7.x86_64 from logrotate-3.8.6-7 or earlier
2.check that /var/lib/logrotate/logrotate.status is empty.


Actual results:
After update /var/lib/logrotate/logrotate.status is empty.

Expected results:
After update /var/lib/logrotate/logrotate.status copied from /var/lib/logrotate.status, if /var/lib/logrotate/logrotate.status not exist before update.

Additional info:
%pre script in SPEC file copies logrotate.status file from old location to new location.
But after that /var/lib/logrotate/logrotate.status 
is copied from RPM despite %config(noreplace), because in a previous version of the package didn't have that file.
Comment 1 Kamil Dudka 2016-11-09 05:46:21 EST
*** Bug 1393209 has been marked as a duplicate of this bug. ***
Comment 2 Kamil Dudka 2016-11-09 05:55:50 EST
Confirmed.  Thanks for the analysis!  The workaround is to copy the saved state file into the new location manually after the update:

# cp -a /var/lib/logrotate.status.rpmsave /var/lib/logrotate/logrotate.status

Sorry for the troubles!
Comment 3 Kamil Dudka 2016-11-10 06:15:04 EST
I believe this could fixed by using the %ghost directive for logrotate.status:

--- a/logrotate.spec
+++ b/logrotate.spec
@@ -91,7 +91,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(0644, root, root) %config(noreplace) %{_sysconfdir}/logrotate.conf
 %attr(0755, root, root) %dir %{_sysconfdir}/logrotate.d
 %attr(0755, root, root) %dir %{_localstatedir}/lib/logrotate
-%attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate/logrotate.status
+%attr(0644, root, root) %ghost %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate/logrotate.status
 %config(noreplace) %{_sysconfdir}/rwtab.d/logrotate

 %changelog
Comment 7 Kamil Dudka 2016-11-11 11:28:10 EST
fixed in logrotate-3.10.0-3.fc26:

http://pkgs.fedoraproject.org/cgit/rpms/logrotate.git/commit/?id=bd156318
Comment 21 errata-xmlrpc 2017-08-01 12:19:24 EDT
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-2017:1889

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