From f2a86ddf9331cd7387c44ba03307adac43575fc4 Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Fri, 27 Dec 2019 13:26:04 +0000 Subject: extras: enable log rotation for USS logs Added logrotate support for user serviceable snapshot's logs. Change-Id: Ic920eaa8ab5e44daf5937a027c6913d7bb26d517 Fixes: bz#1786722 Signed-off-by: Sunny Kumar --- extras/glusterfs-logrotate | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'extras') 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 +} -- cgit