sonic-buildimage/files/image_config/logrotate
Liping Xu 95d11976bd
update rsyslog log size conf (#15821)
Why I did it
For some devices whose log folder size is larger than 200M, for example, 256M, the LOG_FILE_ROTATE_SIZE_KB should be 16M. and
THRESHOLD_KB=$((USABLE_SPACE_KB - (NUM_LOGS_TO_ROTATE * LOG_FILE_ROTATE_SIZE_KB * 2)))
= $(( (VAR_LOG_SIZE_KB * 90 / 100) - RESERVED_SPACE_KB)) - (NUM_LOGS_TO_ROTATE * LOG_FILE_ROTATE_SIZE_KB * 2)))
= $(( (256M * 90 / 100) - 4096)) - (8 * 16M * 2)))
the result would be a negative value

Work item tracking
Microsoft ADO (number only):
24524827
How I did it
Add a case for 400M, if the log folder size is between 200M and 400M, set the log file size to 2M

How to verify it
Do cmd "sudo logrotate -f /etc/logrotate.conf" on DUT which val/log folder size is 256M, and check the syslog.
2023-07-14 15:44:17 +08:00
..
logrotate.d [rsyslog]Setting log file size to 16Mb (#9504) 2022-01-14 10:24:07 -08:00
logrotate-config.service [rsyslog]Setting log file size to 16Mb (#9504) 2022-01-14 10:24:07 -08:00
logrotate-config.sh [rsyslog]Setting log file size to 16Mb (#9504) 2022-01-14 10:24:07 -08:00
logrotate.conf [System logs]: Improvements to prevent filling /var/log partition (#865) 2017-08-10 16:24:57 -07:00
rsyslog.j2 update rsyslog log size conf (#15821) 2023-07-14 15:44:17 +08:00
timerOverride.conf Replace logrotate cron file with (adapted) systemd timer file (#12921) 2022-12-08 14:13:11 -08:00