From faa57434abfe81103387078494fc56d6ef6c479c Mon Sep 17 00:00:00 2001 From: Rakesh Date: Thu, 24 Jun 2021 07:37:06 +0200 Subject: [PATCH] systemvm: Change logrotate interval to hourly (#5132) * Change logrotate interval to hourly The logrotate config says interval as hourly but it relies on timer service to be invoked but in timer the frequency is mentioned as 12h. So it wont be invoked every hour. So change the frequency to hourly * Add change to vpc router --- systemvm/debian/opt/cloud/bin/setup/router.sh | 7 +++++++ systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/systemvm/debian/opt/cloud/bin/setup/router.sh b/systemvm/debian/opt/cloud/bin/setup/router.sh index 7c9549354e1..e8f6edf0ceb 100755 --- a/systemvm/debian/opt/cloud/bin/setup/router.sh +++ b/systemvm/debian/opt/cloud/bin/setup/router.sh @@ -100,6 +100,13 @@ setup_router() { mv -n /etc/cron.daily/logrotate /etc/cron.hourly 2>&1 fi + # Setup hourly lograte in systemd timer + sed -i 's/OnCalendar=daily/OnCalendar=hourly/g' /usr/lib/systemd/system/logrotate.timer + sed -i 's/AccuracySec=12h/AccuracySec=5m/g' /usr/lib/systemd/system/logrotate.timer + + # reload daemon + /usr/bin/systemctl daemon-reload + # Load modules to support NAT traversal in VR modprobe nf_nat_pptp } diff --git a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh index 68877821fb3..f97fb161f47 100755 --- a/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh +++ b/systemvm/debian/opt/cloud/bin/setup/vpcrouter.sh @@ -113,6 +113,13 @@ EOF mv -n /etc/cron.daily/logrotate /etc/cron.hourly 2>&1 fi + # Setup hourly lograte in systemd timer + sed -i 's/OnCalendar=daily/OnCalendar=hourly/g' /usr/lib/systemd/system/logrotate.timer + sed -i 's/AccuracySec=12h/AccuracySec=5m/g' /usr/lib/systemd/system/logrotate.timer + + # reload daemon + /usr/bin/systemctl daemon-reload + # Load modules to support NAT traversal in VR modprobe nf_nat_pptp }