[GH-ISSUE #170] [BUG] logrotate fails with duplicate log entry for /var/log/{wtmp,btmp} error #66

Closed
opened 2026-03-03 13:58:51 +03:00 by kerem · 3 comments
Owner

Originally created by @bob-rove on GitHub (Sep 16, 2022).
Original GitHub issue: https://github.com/konstruktoid/hardening/issues/170

Originally assigned to: @konstruktoid on GitHub.

Describe the bug

/usr/sbin/logrotate /etc/logrotate.conf exists with the following error:

error: /etc/logrotate.conf:30 duplicate log entry for /var/log/wtmp
error: /etc/logrotate.conf:37 duplicate log entry for /var/log/btmp

Worth noting that original issue seems to be coming from logrotate package: https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1915759
(TLDR: maintainers seem to come to conclusion to comment out /var/log/[bw]tmp { ... } blocks in /etc/logrotate.conf and rely on their equivalents in /etc/logrotate.d/[bw]tmp)

Although I'm not entirely sure if this constitutes for a bug, given that package-supplied logrotate.conf is being overwritten by the file from this repo, perhaps it's worth considering fixing it here now, while anticipating upcoming fix in logrotate package.

To Reproduce

Run /usr/sbin/logrotate /etc/logrotate.conf as called from systemd and cron.

Expected behavior

No errors and exit code 0.

System (lsb_release -a):

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:        22.04
Codename:       jammy

Additional context

Same problem reported in logrotate package issue tracker: https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1915759

Originally created by @bob-rove on GitHub (Sep 16, 2022). Original GitHub issue: https://github.com/konstruktoid/hardening/issues/170 Originally assigned to: @konstruktoid on GitHub. **Describe the bug** `/usr/sbin/logrotate /etc/logrotate.conf` exists with the following error: ```bash error: /etc/logrotate.conf:30 duplicate log entry for /var/log/wtmp error: /etc/logrotate.conf:37 duplicate log entry for /var/log/btmp ``` Worth noting that original issue seems to be coming from `logrotate` package: https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1915759 (TLDR: maintainers seem to come to conclusion to comment out `/var/log/[bw]tmp { ... }` blocks in `/etc/logrotate.conf` and rely on their equivalents in `/etc/logrotate.d/[bw]tmp`) Although I'm not entirely sure if this constitutes for a bug, given that package-supplied `logrotate.conf` is being overwritten by the file from this repo, perhaps it's worth considering fixing it here now, while anticipating upcoming fix in `logrotate` package. **To Reproduce** Run `/usr/sbin/logrotate /etc/logrotate.conf` as called from `systemd` and `cron`. **Expected behavior** No errors and exit code `0`. **System (lsb_release -a):** ```bash No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release: 22.04 Codename: jammy ``` **Additional context** Same problem reported in `logrotate` package issue tracker: https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1915759
kerem closed this issue 2026-03-03 13:58:52 +03:00
Author
Owner

@konstruktoid commented on GitHub (Sep 16, 2022):

Thanks again @bob-rove, will have a look at it as soon as possible.

<!-- gh-comment-id:1249292228 --> @konstruktoid commented on GitHub (Sep 16, 2022): Thanks again @bob-rove, will have a look at it as soon as possible.
Author
Owner

@konstruktoid commented on GitHub (Sep 19, 2022):

Updated the config file for logrotate @bob-rove to make it match upstream.

I believe https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1915759 can be closed since an up-to-date Focal and Jammy don't include the duplicate code.

<!-- gh-comment-id:1251478412 --> @konstruktoid commented on GitHub (Sep 19, 2022): Updated the config file for logrotate @bob-rove to make it match upstream. I believe https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1915759 can be closed since an up-to-date Focal and Jammy don't include the duplicate code.
Author
Owner

@bob-rove commented on GitHub (Sep 21, 2022):

Cool stuff, thanks @konstruktoid ! 🙌

<!-- gh-comment-id:1253869469 --> @bob-rove commented on GitHub (Sep 21, 2022): Cool stuff, thanks @konstruktoid ! 🙌
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hardening#66
No description provided.