Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[action] [PR:15821] update rsyslog log size conf #16325

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

mssonicbld
Copy link
Collaborator

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 LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh LOG_FILE_ROTATE_SIZE_KB LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh 2)))
= $(( (VAR_LOG_SIZE_KB LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh 90 / 100) - RESERVED_SPACE_KB)) - (NUM_LOGS_TO_ROTATE LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh LOG_FILE_ROTATE_SIZE_KB LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh 2)))
= $(( (256M LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh 90 / 100) - 4096)) - (8 LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh 16M LICENSE MAINTAINERS Makefile Makefile.cache Makefile.work README.buildsystem.md README.md ThirdPartyLicenses.txt azure-pipelines.yml build_debian.sh build_debug_docker_j2.sh build_docker.sh build_image.sh check_install.py device dockers files functions.sh get_docker-base.sh install_sonic.py installer onie-image-arm64.conf onie-image-armhf.conf onie-image.conf onie-mk-demo.sh platform push_docker.sh rules scripts slave.mk sonic-slave-bullseye sonic-slave-buster sonic-slave-jessie sonic-slave-stretch src update_screen.sh 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.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

  • 202205

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

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.
@mssonicbld
Copy link
Collaborator Author

Original PR: #15821

@mssonicbld
Copy link
Collaborator Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lipxu lipxu self-requested a review August 30, 2023 01:36
Copy link
Contributor

@lipxu lipxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mssonicbld
Copy link
Collaborator Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit ddb4ce1 into sonic-net:202211 Sep 1, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants