Bug 700536

Summary: /var/log/btmp not rotated
Product: Red Hat Enterprise Linux 5 Reporter: Christopher Hirschmann <c.hirschmann-bugs>
Component: logrotateAssignee: Jan Kaluža <jkaluza>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.6CC: dcleal, notting, tsmetana
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-15 08:25:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christopher Hirschmann 2011-04-28 15:49:47 UTC
Description of problem:

The file /var/log/btmp is not rotated and can grow to enormous sizes. The closely related file /var/log/wtmp is mentioned in /etc/logrotate.conf and will be rotated, /var/log/btmp should be treated the same way.


Version-Release number of selected component (if applicable): 3.7.4-9


How reproducible: always


Steps to Reproduce:
1. setup system with packages initscripts and logrotate installed 
2. let /var/log/btmp grow (you can generate failed logins that will be logged in this file with a script for fast reproduction)
  

Actual results: /var/log/btmp will not get rotated and can grow to enormous size


Expected results: /var/log/btmp should be rotated with logrotate after it grows to a certain size, just like /var/log/wtmp


Additional info:

This is a possible regression on bug #117844.

The Specfile mentions /var/log/btmp only once on line 188:

"- Add section to logrotate.conf for "/var/log/btmp" (#117844)"

However, no such section is added to logrotate.conf. According to the specfile logrotate.conf is copied from the source tarball and installed into the system without further changes:

line 52: install -m 644 examples/logrotate-default $RPM_BUILD_ROOT/etc/logrotate.conf
line 65: %attr(0644, root, root) %config(noreplace) /etc/logrotate.conf

This bug might also affect RHEL 4 and 6, I haven't checked.

Also, I'm wondering about the comment "no packages own wtmp -- we'll rotate them here" in logrotate.conf. According to RPM, /var/log/wtmp and /var/log/btmp are owned by the initscripts package, so maybe it would be a good idea to move rotation of /var/log/wtmp from logrotate.conf into an extra file in /etc/logrotate.d/initscripts and put that file into the initscripts package or something like that.

Comment 5 Jan Kaluža 2012-05-15 08:25:44 UTC
I've just found out this bug has been fixed in logrotate-3.7.4-12 as part of Bug 485553 fix. I will close this one as duplicate of Bug 485553.

*** This bug has been marked as a duplicate of bug 485553 ***