summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2019-12-27 13:26:04 +0000
committerSunny Kumar <sunkumar@redhat.com>2020-02-17 13:55:12 +0000
commitded282f8bd6728bab76111f6775abc6e45affc18 (patch)
treecf84d1376ebd19cee67a06f87a09e0d31defcf8b
parent7c0ef8f5c0ca30c4e889ff5ba22eca490572fc75 (diff)
extras: enable log rotation for USS logs
Added logrotate support for user serviceable snapshot's logs. Backport of: >Upstream patch: https://review.gluster.org/#/c/glusterfs/+/23930/ >Change-Id: Ic920eaa8ab5e44daf5937a027c6913d7bb26d517 >Fixes: bz#1786722 >Signed-off-by: Sunny Kumar <sunkumar@redhat.com> >(cherry picked from commit f2a86ddf9331cd7387c44ba03307adac43575fc4) Change-Id: Ic920eaa8ab5e44daf5937a027c6913d7bb26d517 Fixes: bz#1803810 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
-rw-r--r--extras/glusterfs-logrotate21
1 files changed, 21 insertions, 0 deletions
diff --git a/extras/glusterfs-logrotate b/extras/glusterfs-logrotate
index 575c0eee771..d35cfd3467b 100644
--- a/extras/glusterfs-logrotate
+++ b/extras/glusterfs-logrotate
@@ -35,3 +35,24 @@
compress
delaycompress
}
+
+# Rotate snapd log
+/var/log/glusterfs/snaps/*/*.log {
+ sharedscripts
+ weekly
+ maxsize 10M
+ minsize 100k
+
+ # 6 months of logs are good enough
+ rotate 26
+
+ missingok
+ compress
+ delaycompress
+ notifempty
+ postrotate
+ for pid in `ps -aef | grep glusterfs | egrep "snapd" | awk '{print $2}'`; do
+ /usr/bin/kill -HUP $pid > /dev/null 2>&1 || true
+ done
+ endscript
+}