"Duplicate log entry" instead of later definitions overriding earlier ones, as man page says

Bug #2003645 reported by Jani Uusitalo
6
This bug affects 1 person
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/logrotate/status
        ACL support: yes
        SELinux support: yes
    $ mkdir /tmp/logrotest
    $ cd /tmp/logrotest
    $ touch test.log
    $ touch other.log
    $ cat >logrotate.conf
    /tmp/logrotest/*.log {
        minsize 5M
    }

    /tmp/logrotest/test.log {
        minsize 1M
    }
    $ logrotate --state /tmp/logrostate logrotate.conf

== What happens ==

    error: logrotate.conf:5 duplicate log entry for /tmp/logrotest/test.log

== 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
ProcVersionSignature: Ubuntu 5.15.0-58.64~20.04.1-generic 5.15.74
Uname: Linux 5.15.0-58-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu27.25
Architecture: amd64
CasperMD5CheckResult: skip
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.conffile..etc.apport.crashdb.conf: [modified]
modified.conffile..etc.default.apport: [modified]
mtime.conffile..etc.apport.crashdb.conf: 2021-06-01T13:11:35.779891
mtime.conffile..etc.default.apport: 2020-11-30T20:24:48.587084

Revision history for this message
Jani Uusitalo (uusijani) wrote :
Revision history for this message
Jani Uusitalo (uusijani) wrote :

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.