"Duplicate log entry" instead of later definitions overriding earlier ones, as man page says
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logrotate (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The man page for logrotate says "Each configuration file can set global options (local definitions override global ones, and later definitions override earlier ones)". This is inconsistent with how it actually behaves.
== Steps to reproduce ==
$ logrotate --version
logrotate 3.14.0
Default mail command: /usr/bin/mail
Default compress command: /bin/gzip
Default uncompress command: /bin/gunzip
Default compress extension: .gz
Default state file path: /var/lib/
ACL support: yes
SELinux support: yes
$ mkdir /tmp/logrotest
$ cd /tmp/logrotest
$ touch test.log
$ touch other.log
$ cat >logrotate.conf
/tmp/
minsize 5M
}
/tmp/
minsize 1M
}
$ logrotate --state /tmp/logrostate logrotate.conf
== What happens ==
error: logrotate.conf:5 duplicate log entry for /tmp/logrotest/
== What I expect to happen instead ==
No error, test.log being processed with its specific, later-defined directives.
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: logrotate 3.14.0-4ubuntu3
ProcVersionSign
Uname: Linux 5.15.0-58-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Sun Jan 22 11:46:59 2023
InstallationDate: Installed on 2020-11-30 (782 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
SourcePackage: logrotate
UpgradeStatus: No upgrade log present (probably fresh install)
modified.
modified.
mtime.conffile.
mtime.conffile.
In fact the man page seems to be completely out of sync with reality. None of minage, maxage, minsize and maxsize appear to work at all despite being documented there. Minage is read at least (according to debug output), but then still ignored. Specifying minsize or maxsize has no effect, logs are rotated when they hit 1 M regardless. At least the plain `size` directive does appear to work as documented.