Bug 247410
| Summary: | Logrotate 3.7.4 does not honor size directive | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Seth Robertson <in-redhat> | ||||
| Component: | logrotate | Assignee: | Tomas Smetana <tsmetana> | ||||
| Status: | CLOSED ERRATA | QA Contact: | |||||
| Severity: | low | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 5.0 | CC: | brandon.franks.011, chet.burgess, joel.winteregg, mmalik, ssaux | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | RHBA-2007-1002 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2007-11-15 14:07:41 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: | |||||||
| Attachments: |
|
||||||
You're right. Thanks for reporting. I didn't see a fix for this issue and since I needed the latest logrotate to address another bug I was encountering I have created a patch for this bug. I have attached a simple fix for this issue. Created attachment 160651 [details]
Patch to address size option not working
This bug is against RHEL, so you have to wait for the next update. If you require a hotfix then you must contact the customer support. *** Bug 251596 has been marked as a duplicate of this bug. *** An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2007-1002.html *** Bug 448622 has been marked as a duplicate of this bug. *** I am experiencing this bug while using logrotate version 3.8.6. Why is that? |
Description of problem: Version-Release number of selected component (if applicable): 3.7.4 How reproducible: Steps to Reproduce: 1. echo foo > foo 2. cat > foo.logrotate <<EOF $PWD/foo { size 1 rotate 2 } EOF 3. logrotate -dv foo Actual results: logrotate -dv foo.logrotate reading config file foo.logrotate reading config info for /tmp/logrotate-3.7.4/foo Handling 1 logs rotating pattern: /tmp/logrotate-3.7.4/foo 1048576 bytes (2 rotations) empty log files are rotated, only log files >= 1 bytes are rotated, old logs are removed considering log /tmp/logrotate-3.7.4/foo log does not need rotating Expected results: reading config file foo.logrotate reading config info for /tmp/logrotate-3.7.4/foo Handling 1 logs rotating pattern: /tmp/logrotate-3.7.4/foo 1 bytes (2 rotations) empty log files are rotated, old logs are removed considering log /tmp/logrotate-3.7.4/foo log needs rotating rotating log /tmp/logrotate-3.7.4/foo, log->rotateCount is 2 renaming /tmp/logrotate-3.7.4/foo.2 to /tmp/logrotate-3.7.4/foo.3 (rotatecount 2, logstart 1, i 2), renaming /tmp/logrotate-3.7.4/foo.1 to /tmp/logrotate-3.7.4/foo.2 (rotatecount 2, logstart 1, i 1), renaming /tmp/logrotate-3.7.4/foo.0 to /tmp/logrotate-3.7.4/foo.1 (rotatecount 2, logstart 1, i 0), renaming /tmp/logrotate-3.7.4/foo to /tmp/logrotate-3.7.4/foo.1 removing old log /tmp/logrotate-3.7.4/foo.3 Additional info: Bug is at config.c line 620 being interfered with by 589. You compare size against opt, but the string opt pointed to was restored to its original value on line 589 which causes the match to fail. This means assignments to size and minsize always get assigned to minsize.