diff options
author | Venky Shankar <venky@gluster.com> | 2011-10-24 15:29:00 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-11-04 02:06:44 -0700 |
commit | 8e171a03d81452a2998b01997da7647c0b3bf52b (patch) | |
tree | 54117831ec7c55fe0b1bb67f9ec227c5fe2059c6 /xlators/features/marker/utils/syncdaemon/gsyncd.py | |
parent | cc0a908bc5d5046bcb2909fc98765038f15e918d (diff) |
cli: add geo-replication log-rotate command
Rotating geo-replication master/monitor log files from cli.
On invocation, the log file for a given master-slave session
is backed up with the current timestamp suffixed to the file
name and signal is sent to gsyncd to start logging to a new
log file.
Sample commands:
* Rotate log file for this <master>:<slave> session:
gluster volume geo-replication <master> <slave> log-rotate
* Rotate log files for all session for master volume <master>
gluster volume geo-replication <master> log-rotate
* Rotate log files for all sessions:
gluster volume geo-replication log-rotate
Change-Id: If801743e9f37bd282e68d262203141626ce77e55
BUG: 3519
Reviewed-on: http://review.gluster.com/653
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Csaba Henk <csaba@gluster.com>
Diffstat (limited to 'xlators/features/marker/utils/syncdaemon/gsyncd.py')
-rw-r--r-- | xlators/features/marker/utils/syncdaemon/gsyncd.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/gsyncd.py b/xlators/features/marker/utils/syncdaemon/gsyncd.py index 193af9d5f..99e2204b2 100644 --- a/xlators/features/marker/utils/syncdaemon/gsyncd.py +++ b/xlators/features/marker/utils/syncdaemon/gsyncd.py @@ -6,7 +6,6 @@ import sys import time import logging import signal -import select import optparse import fcntl from optparse import OptionParser, SUPPRESS_HELP @@ -15,6 +14,7 @@ from errno import EEXIST, ENOENT from gconf import gconf from syncdutils import FreeObject, norm, grabpidfile, finalize, log_raise_exception +from syncdutils import select from configinterface import GConffile import resource from monitor import monitor @@ -78,7 +78,7 @@ def startup(**kw): # so we can start up with # no messing from the dirty # ol' bustard - select.select((x,), (), ()) + select((x,), (), ()) os.close(x) lkw = {} @@ -93,6 +93,9 @@ def startup(**kw): lkw['filename'] = kw['log_file'] GLogger.setup(label=kw.get('label'), **lkw) + lkw.update({'saved_label': kw.get('label')}) + gconf.log_metadata = lkw + def main(): signal.signal(signal.SIGTERM, lambda *a: finalize(*a, **{'exval': 1})) GLogger.setup() |