Hide Forgot
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.
*** Bug 1393209 has been marked as a duplicate of this bug. ***
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!
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
fixed in logrotate-3.10.0-3.fc26: http://pkgs.fedoraproject.org/cgit/rpms/logrotate.git/commit/?id=bd156318
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