From 6ac06e5e5e3ceed4a3e3a86ea5f82ffb59c266f2 Mon Sep 17 00:00:00 2001 From: Abhinandan Prateek Date: Mon, 30 Mar 2015 11:36:11 +0530 Subject: [PATCH] CLOUDSTACK-6885: rotate logs hourly on VR --- systemvm/patches/debian/config/etc/init.d/cloud-early-config | 4 ++++ systemvm/patches/debian/config/etc/logrotate.conf | 2 +- systemvm/patches/debian/config/etc/logrotate.d/cloud | 3 --- systemvm/patches/debian/config/etc/logrotate.d/rsyslog | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config index 729b58f5f6a..5a2ee6fa1a0 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config +++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config @@ -995,6 +995,10 @@ setup_router() { sed -i "s/-A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT/-A INPUT -i eth0 -p udp -m udp --dport 53 -s $DHCP_RANGE\/$CIDR_SIZE -j ACCEPT/g" /etc/iptables/rules sed -i "s/-A INPUT -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT/-A INPUT -i eth0 -p tcp -m tcp --dport 53 -s $DHCP_RANGE\/$CIDR_SIZE -j ACCEPT/g" /etc/iptables/rules.v4 sed -i "s/-A INPUT -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT/-A INPUT -i eth0 -p tcp -m tcp --dport 53 -s $DHCP_RANGE\/$CIDR_SIZE -j ACCEPT/g" /etc/iptables/rules + + #setup hourly logrotate + mv -n /etc/cron.daily/logrotate /etc/cron.hourly 2>&1 + } diff --git a/systemvm/patches/debian/config/etc/logrotate.conf b/systemvm/patches/debian/config/etc/logrotate.conf index 59a6242bb4c..6b5fcc665cf 100644 --- a/systemvm/patches/debian/config/etc/logrotate.conf +++ b/systemvm/patches/debian/config/etc/logrotate.conf @@ -5,7 +5,7 @@ rotate 5 # create new (empty) log files after rotating old ones create # use date as a suffix of the rotated file -dateext +#dateext # max size 50M size 50M # RPM packages drop log rotation information into this directory diff --git a/systemvm/patches/debian/config/etc/logrotate.d/cloud b/systemvm/patches/debian/config/etc/logrotate.d/cloud index 617b09b2adc..5d95942f6a7 100644 --- a/systemvm/patches/debian/config/etc/logrotate.d/cloud +++ b/systemvm/patches/debian/config/etc/logrotate.d/cloud @@ -21,7 +21,4 @@ notifempty compress delaycompress - postrotate - /usr/bin/pkill socat > /dev/null - endscript } diff --git a/systemvm/patches/debian/config/etc/logrotate.d/rsyslog b/systemvm/patches/debian/config/etc/logrotate.d/rsyslog index faa87761334..5803c43d875 100644 --- a/systemvm/patches/debian/config/etc/logrotate.d/rsyslog +++ b/systemvm/patches/debian/config/etc/logrotate.d/rsyslog @@ -2,6 +2,7 @@ { rotate 7 daily + size 50M missingok notifempty delaycompress @@ -26,6 +27,7 @@ { rotate 10 daily + size 50M missingok notifempty compress