From 8d034b840e957d96a3c3e1f86a3ff28aabb8c896 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Mon, 18 Apr 2011 17:25:29 +0000 Subject: syncdaemon: add session-owner option Signed-off-by: Csaba Henk Signed-off-by: Anand Avati BUG: 2785 (gsyncd logs on slave side go to /dev/null) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2785 --- xlators/features/marker/utils/syncdaemon/gsyncd.py | 1 + xlators/features/marker/utils/syncdaemon/resource.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'xlators/features') diff --git a/xlators/features/marker/utils/syncdaemon/gsyncd.py b/xlators/features/marker/utils/syncdaemon/gsyncd.py index 76358414f..c52d1a218 100644 --- a/xlators/features/marker/utils/syncdaemon/gsyncd.py +++ b/xlators/features/marker/utils/syncdaemon/gsyncd.py @@ -129,6 +129,7 @@ def main_i(): op.add_option('-L', '--log-level', metavar='LVL') op.add_option('-r', '--remote-gsyncd', metavar='CMD', default=os.path.abspath(sys.argv[0])) op.add_option('--volume-id', metavar='UUID') + op.add_option('--session-owner', metavar='ID') op.add_option('-s', '--ssh-command', metavar='CMD', default='ssh') op.add_option('--rsync-command', metavar='CMD', default='rsync') op.add_option('--rsync-extra', metavar='ARGS', default='-sS', help=SUPPRESS_HELP) diff --git a/xlators/features/marker/utils/syncdaemon/resource.py b/xlators/features/marker/utils/syncdaemon/resource.py index 7db7d5bb4..3987b7ae9 100644 --- a/xlators/features/marker/utils/syncdaemon/resource.py +++ b/xlators/features/marker/utils/syncdaemon/resource.py @@ -220,7 +220,13 @@ class SlaveRemote(object): os.dup2(ix, sys.stdin.fileno()) os.close(iy) os.dup2(oy, sys.stdout.fileno()) - argv = rargs + gconf.remote_gsyncd.split() + ['-N', '--listen', '--timeout', str(gconf.timeout), slave] + so = getattr(gconf, 'session_owner', None) + if so: + so_args = ['--session-owner', so] + else: + so_args = [] + argv = rargs + gconf.remote_gsyncd.split() + so_args + \ + ['-N', '--listen', '--timeout', str(gconf.timeout), slave] os.execvp(argv[0], argv) os.close(ix) os.close(oy) -- cgit