summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2013-01-22 11:42:10 +0530
committerAnand Avati <avati@redhat.com>2013-02-04 17:34:56 -0800
commit3804a3413daf7180da0f3fe9d5ea1c5c157d38cb (patch)
treee2a3fe065494b33084e7f9b2b9a344933b300690 /xlators/features/marker
parentc6116f744fe4791a8fa54778840316275e473587 (diff)
geo-rep / gsyncd: Separate log file directory for Mountbroker sessions
... so that a mountbroker session which is initiated b/w master and slave does not use the same log file if it's started after a normal geo-rep session b/w master and slave. This results in EPERM as the log file is owned by root and the geo-rep slave process (now running as a non privileged user) does not have access to it. Also, having separate log file directory for mountbroker sessions looks clean. NOTE: geo-rep's client mount log file location remains unchanged. Change-Id: Ic7a732e250aee5393b9c3f6ebf6dfe2c310b7fe4 BUG: 893960 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/4407 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/features/marker')
-rw-r--r--xlators/features/marker/utils/syncdaemon/gsyncd.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/gsyncd.py b/xlators/features/marker/utils/syncdaemon/gsyncd.py
index efb0e3aa50a..387900e6ce8 100644
--- a/xlators/features/marker/utils/syncdaemon/gsyncd.py
+++ b/xlators/features/marker/utils/syncdaemon/gsyncd.py
@@ -17,7 +17,7 @@ from ipaddr import IPAddress, IPNetwork
from gconf import gconf
from syncdutils import FreeObject, norm, grabpidfile, finalize, log_raise_exception
-from syncdutils import GsyncdError, select, set_term_handler
+from syncdutils import GsyncdError, select, set_term_handler, privileged
from configinterface import GConffile
import resource
from monitor import monitor
@@ -157,6 +157,7 @@ def main_i():
op.add_option('--mountbroker', metavar='LABEL')
op.add_option('-p', '--pid-file', metavar='PIDF', type=str, action='callback', callback=store_abs)
op.add_option('-l', '--log-file', metavar='LOGF', type=str, action='callback', callback=store_abs)
+ op.add_option('--log-file-mbr', metavar='LOGF', type=str, action='callback', callback=store_abs)
op.add_option('--state-file', metavar='STATF', type=str, action='callback', callback=store_abs)
op.add_option('--ignore-deletes', default=False, action='store_true')
op.add_option('--use-rsync-xattrs', default=False, action='store_true')
@@ -357,6 +358,9 @@ def main_i():
raise GsyncdError('cannot recognize log level "%s"' % lvl0)
gconf.log_level = lvl2
+ if not privileged() and gconf.log_file_mbr:
+ gconf.log_file = gconf.log_file_mbr
+
if checkpoint_change:
try:
GLogger._gsyncd_loginit(log_file=gconf.log_file, label='conf')