path: root/extras
diff options
authorAravinda VK <>2013-09-19 14:24:35 +0530
committerAnand Avati <>2013-10-03 21:26:00 -0700
commit79ba7b3e2ea6e2dc2e720c2cae1e6ae0aeeea392 (patch)
tree24798543ab6d7f8e503b2dff309293012b51bd6c /extras
parenta65d64e89c96b52b9805b63afbbc3e7b67dbc3ad (diff)
geo-rep: logrotate: Logrotate handling
In existing georep logrotate was implemented by handling SIGSTOP and SIGCONT, gsyncd was failing to start again after SIGSTOP. New approach uses WatchedFileHandler in logging, which tracks the log file changes or logrotate. Reopens the log file if logrotate is triggered or if same log file is updated from other process. As per python doc: The WatchedFileHandler class, located in the logging.handlers module, is a FileHandler which watches the file it is logging to. If the file changes, it is closed and reopened using the file name. A file change can happen because of usage of programs such as newsyslog and logrotate which perform log file rotation. This handler, intended for use under Unix/Linux, watches the file to see if it has changed since the last emit. (A file is deemed to have changed if its device or inode have changed.) If the file has changed, the old file stream is closed, and the file opened to get a new stream. Change-Id: I30f65eb1e9778b12943d6e43b60a50344a7885c6 BUG: 1012776 Signed-off-by: Aravinda VK <> Reviewed-on: Reviewed-by: Amar Tumballi <> Reviewed-by: Harshavardhana <> Tested-by: Gluster Build System <> Reviewed-by: Anand Avati <>
Diffstat (limited to 'extras')
2 files changed, 21 insertions, 2 deletions
diff --git a/extras/ b/extras/
index 1ccd9dbd9..cf619329b 100644
--- a/extras/
+++ b/extras/
@@ -6,7 +6,7 @@ SUBDIRS = init.d systemd benchmarking hook-scripts $(OCF_SUBDIR) LinuxRPM geo-re
confdir = $(sysconfdir)/glusterfs
conf_DATA = glusterfs-logrotate gluster-rsyslog-7.2.conf gluster-rsyslog-5.8.conf \
- logger.conf.example
+ logger.conf.example glusterfs-georep-logrotate
voldir = $(sysconfdir)/glusterfs
vol_DATA = glusterd.vol
@@ -16,4 +16,5 @@ EXTRA_DIST = specgen.scm MacOSX/Portfile glusterfs-mode.el glusterfs.vim \ \ glusterfs-logrotate \
group-virt.example glusterd-sysconfig gluster-rsyslog-7.2.conf \
- gluster-rsyslog-5.8.conf logger.conf.example glusterd.vol
+ gluster-rsyslog-5.8.conf logger.conf.example glusterd.vol \
+ glusterfs-georep-logrotate
diff --git a/extras/glusterfs-georep-logrotate b/extras/glusterfs-georep-logrotate
new file mode 100644
index 000000000..6a69ab1e3
--- /dev/null
+++ b/extras/glusterfs-georep-logrotate
@@ -0,0 +1,18 @@
+rotate 52
+/var/log/glusterfs/geo-replication/*/*.log {
+/var/log/glusterfs/geo-replication-slaves/*.log {
+/var/log/glusterfs/geo-replication-slaves/*/*.log {