Bug 1319835 - errors from logrotate
Summary: errors from logrotate
Keywords:
Status: CLOSED DUPLICATE of bug 1144465
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rsyslog
Version: 7.0
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Tomas Heinrich
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-21 15:51 UTC by Shane Voss
Modified: 2016-09-20 04:53 UTC (History)
3 users (show)

Fixed In Version: rsyslog-7.4.7-12.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-09 12:56:49 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Shane Voss 2016-03-21 15:51:08 UTC
Description of problem:
RPM installs logrotate script in /etc/logrotate.d/syslog
This requests a rotation of  /var/log/cron
logrotate gives error messages if the file does not exist.


Version-Release number of selected component (if applicable):
rsyslog-7.4.7-7.el7_0

How reproducible:
Always (unless something else creates /var/log/cron)

Steps to Reproduce:
1. Install RPM
2. /usr/sbin/logrotate /etc/logrotate.d/syslog

Actual results:
error: stat of /var/log/cron failed: No such file or directory


Expected results:
No message - i.e. success

Additional info:
The postinstall scriptlet ensures these files exist:
  /var/log/{messages,secure,maillog,spooler}

Adding cron to that list should resolve this.

Comment 2 Tomas Heinrich 2016-03-30 19:17:21 UTC
Shane, this should already be fixed with the bug 1144465. It seems you're not using the latest packages. Could you please check again with the latest version?

Comment 3 Shane Voss 2016-04-01 08:46:46 UTC
Tomas, you are correct, this is addressed in 7.4.7-12.

The resolution is to use "missingok" in the rotatelog file, which is robust.

With that fix in place there is no need for the postinstall scriptlet to create the files at all.  I think removing that code would be A Good Thing.

Comment 4 Tomas Heinrich 2016-04-01 11:53:36 UTC
(In reply to Shane Voss from comment #3)
> With that fix in place there is no need for the postinstall scriptlet to
> create the files at all.  I think removing that code would be A Good Thing.

I agree that would likely be a good simplification. OTOH, that scriptlet enforces a certain umask on the files. Removing it now would change the behavior.
The code needs rethinking but preferably in Fedora.

Comment 5 Shane Voss 2016-04-01 13:59:33 UTC
(In reply to Tomas Heinrich from comment #4)
> Removing it now would change the behavior.
> The code needs rethinking but preferably in Fedora.

Fair enough.  I am happy with things as they are - thanks!

Comment 6 Tomas Heinrich 2016-08-09 12:56:49 UTC
OK, closing this now.

*** This bug has been marked as a duplicate of bug 1144465 ***


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