summaryrefslogtreecommitdiffstats
path: root/extras/glusterfs-logrotate
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2019-12-27 13:26:04 +0000
committerhari gowtham <hari.gowtham005@gmail.com>2020-02-11 08:22:32 +0000
commit3b2e7ce026f72b939f9300e675e73b4597743e00 (patch)
treecbf75dc34ce87c3da53a0085eac6ae4529e1b61f /extras/glusterfs-logrotate
parentff1eae7f882b8f12380e0c35a9a73b672583cd4c (diff)
extras: enable log rotation for USS logs
Added logrotate support for user serviceable snapshot's logs. Backport of: >Change-Id: Ic920eaa8ab5e44daf5937a027c6913d7bb26d517 >Fixes: bz#1786722 >Signed-off-by: Sunny Kumar <sunkumar@redhat.com> Change-Id: Ic920eaa8ab5e44daf5937a027c6913d7bb26d517 Fixes: bz#1786754 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'extras/glusterfs-logrotate')
-rw-r--r--extras/glusterfs-logrotate21
1 files changed, 21 insertions, 0 deletions
diff --git a/extras/glusterfs-logrotate b/extras/glusterfs-logrotate
index 75f700e6459..6ba6ef18e9f 100644
--- a/extras/glusterfs-logrotate
+++ b/extras/glusterfs-logrotate
@@ -45,3 +45,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
+}