logrotate daily or weekly script silently fails on config error
Issue
If a log file entry is inadvertently duplicated among config files in /etc/logrotate.d , logrotate fails (doesn't rotate any log files), but still returns zero return code, so there's no notification of the issue.
This leads to log files not getting rotated, growing to fill the filesystem.
/etc/cron.daily/logrotate specifically looks for a non-zero return code from the logrotate command it runs in order to alert about an issue.
Because a config duplication error returns 0, no alert is logged.
Environment
- Red Hat Enterprise 7
- Versions prior to logrotate-3.8.6-19.el7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.