Red Hat Bugzilla – Bug 221341
"size" option effectively ignored in config files
Last modified: 2007-11-30 17:11:52 EST
Description of problem:
the "size" config file option is not being honored correctly. When size is
specified, it would always set it to 1M and would not be overridden.
Version-Release number of selected component (if applicable):
instead of using "daily" or "weekly" try using "size 100" or whatnot.
Steps to Reproduce:
1. set "size 100" option in the config file
2. run logrotate -d /etc/logrotate.conf
3. you'll see files greater than 100 bytes not being rotated
log files above "size" are not rotated
those files should be rotated
created quick patch. The problem appears to be in config.c where is does a
strcmp on the "opt" variable to determine if it is seeing "size" or "minsize".
Improper because the "size" text has been removed from "opt" at this point. So
the patch does the check immediately. Should be obvious in the patch..
Created attachment 144746 [details]
quick workaround patch
Created attachment 144803 [details]
I suggest using this patch.