Bug ID 1203714
Summary Logrotate fails due to: "duplicate log entry for ..."
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Basesystem
Assignee screening-team-bugs@suse.de
Reporter paul.pgp-7@gmx.com
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

Logrotate fails due to "duplicate log entry for ..."

Using:
openSUSE Tumbleweed 20220921
logrotate 3.20.1-2.2

Logrotate fails if there are duplicate entries in "/usr/etc/logrotate.d/" and
"/etc/logrotate.d/"

bsc#1173319 appears to be the same issue where it is said the issue is fixed
(comment # 16), however that does not appear to be the case.



paul@Orion-15:~$ systemctl status logrotate
������ logrotate.service - Rotate log files
     Loaded: loaded (/usr/lib/systemd/system/logrotate.service; static)
     Active: failed (Result: exit-code) since Sat 2022-09-24 10:53:36 BST; 1min
33s ago
TriggeredBy: ��������� logrotate.timer
       Docs: man:logrotate(8)
             man:logrotate.conf(5)
    Process: 767 ExecStartPre=/bin/sh -c /usr/bin/systemctl set-environment
etc_conf= (code=exited, status=0/SUCCESS)
    Process: 812 ExecStartPre=/bin/sh -c if [ -f /etc/logrotate.conf ]; then
/usr/bin/systemctl set-environment etc_conf=/etc/logrotate.con>
    Process: 824 ExecStartPre=/bin/sh -c /usr/bin/systemctl set-environment
etc_dir= (code=exited, status=0/SUCCESS)
    Process: 832 ExecStartPre=/bin/sh -c if [ -d /etc/logrotate.d ]; then
/usr/bin/systemctl set-environment etc_dir=/etc/logrotate.d; fi (>
    Process: 834 ExecStart=/bin/sh -c /usr/sbin/logrotate
/usr/etc/logrotate.conf ${etc_conf} ${etc_dir} (code=exited, status=1/FAILURE)
   Main PID: 834 (code=exited, status=1/FAILURE)
        CPU: 3.699s

Sep 24 10:53:30 Orion-15.openSUSE sh[834]: error: zypp-history.lr:1 duplicate
log entry for /var/log/zypp/history
Sep 24 10:53:30 Orion-15.openSUSE sh[834]: error: found error in file
zypp-history.lr, skipping
Sep 24 10:53:30 Orion-15.openSUSE sh[834]: error: zypp-refresh.lr:1 duplicate
log entry for /var/log/zypp-refresh.log
Sep 24 10:53:30 Orion-15.openSUSE sh[834]: error: found error in file
zypp-refresh.lr, skipping
Sep 24 10:53:30 Orion-15.openSUSE sh[834]: error: zypper.lr:1 duplicate log
entry for /var/log/zypper.log
Sep 24 10:53:30 Orion-15.openSUSE sh[834]: error: found error in file
zypper.lr, skipping
Sep 24 10:53:36 Orion-15.openSUSE systemd[1]: logrotate.service: Main process
exited, code=exited, status=1/FAILURE
Sep 24 10:53:36 Orion-15.openSUSE systemd[1]: logrotate.service: Failed with
result 'exit-code'.
Sep 24 10:53:36 Orion-15.openSUSE systemd[1]: Failed to start Rotate log files.
Sep 24 10:53:36 Orion-15.openSUSE systemd[1]: logrotate.service: Consumed
3.699s CPU time.
paul@Orion-15:~$ 



paul@Orion-15:~$ cat /usr/etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
dateext

# uncomment this if you want your log files compressed
compress

# comment these to switch compression to use gzip or another
# compression scheme
compresscmd /usr/bin/xz
uncompresscmd /usr/bin/xzdec

# RPM packages drop log rotation information into this directory
include /usr/etc/logrotate.d
paul@Orion-15:~$



paul@Orion-15:~$ cat /usr/etc/logrotate.d/zypp-history.lr
/var/log/zypp/history {
    compress
    dateext
    notifempty
    missingok
    nocreate

    maxage 1827
    rotate 99
    size 10M
}
paul@Orion-15:~$



paul@Orion-15:~$ cat /etc/logrotate.d/zypp-history.lr
/var/log/zypp/history {
    compress
    dateext
    notifempty
    missingok
    nocreate

    maxage 365
    rotate 10
    size 10M
}
paul@Orion-15:~$


You are receiving this mail because: