summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2018-01-29 12:42:51 +0530
committerAravinda VK <avishwan@redhat.com>2018-01-29 13:03:00 +0530
commit596143a286079338c30c8abc4b862f8d6ddddb3a (patch)
tree7bfc0d4cfb3f8edef6f2de0d40e948682bb4a0f4 /geo-replication
parent5d3c90d14839fc134580a4ff944d68f3ff3c605a (diff)
geo-rep: Remove unused working directory check in gsyncd
To append the default config file path, gsyncd calls gluster command to get the workdir path and constructs config file path. This is not required now since the Config management in Geo-replication is changed with patch 18257(Issue #73) BUG: 1539545 Change-Id: Ia7eb39e36ed59ece4de65ea7ec71a0f615e338bb Signed-off-by: Aravinda VK <avishwan@redhat.com>
Diffstat (limited to 'geo-replication')
-rw-r--r--geo-replication/src/gsyncd.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/geo-replication/src/gsyncd.c b/geo-replication/src/gsyncd.c
index 2c48ca5d540..df2ee35b037 100644
--- a/geo-replication/src/gsyncd.c
+++ b/geo-replication/src/gsyncd.c
@@ -111,44 +111,11 @@ str2argv (char *str, char ***argv)
static int
invoke_gsyncd (int argc, char **argv)
{
- char config_file[PATH_MAX] = {0,};
- size_t gluster_workdir_len = 0;
- runner_t runner = {0,};
int i = 0;
int j = 0;
char *nargv[argc + 4];
char *python = NULL;
- if (restricted) {
- size_t len;
- /* in restricted mode we forcibly use the system-wide config */
- runinit (&runner);
- runner_add_args (&runner, SBIN_DIR"/gluster",
- "--remote-host=localhost",
- "--log-file=-", "system::", "getwd",
- NULL);
- runner_redir (&runner, STDOUT_FILENO, RUN_PIPE);
- if (runner_start (&runner) == 0 &&
- fgets (config_file, PATH_MAX,
- runner_chio (&runner, STDOUT_FILENO)) != NULL &&
- (len = strlen (config_file)) &&
- config_file[len - 1] == '\n' &&
- runner_end (&runner) == 0)
- gluster_workdir_len = len - 1;
-
- if (gluster_workdir_len) {
- if (gluster_workdir_len + 1 + strlen (GSYNCD_CONF_TEMPLATE) + 1 >
- PATH_MAX)
- goto error;
- config_file[gluster_workdir_len] = '/';
- strcat (config_file, GSYNCD_CONF_TEMPLATE);
- } else
- goto error;
-
- if (setenv ("_GSYNCD_RESTRICTED_", "1", 1) == -1)
- goto error;
- }
-
if (chdir ("/") == -1)
goto error;
@@ -160,10 +127,7 @@ invoke_gsyncd (int argc, char **argv)
nargv[j++] = GSYNCD_PREFIX"/python/syncdaemon/"GSYNCD_PY;
for (i = 1; i < argc; i++)
nargv[j++] = argv[i];
- if (config_file[0]) {
- nargv[j++] = "-c";
- nargv[j++] = config_file;
- }
+
nargv[j++] = NULL;
execvp (python, nargv);