summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
Diffstat (limited to 'geo-replication')
-rw-r--r--geo-replication/src/Makefile.am6
-rw-r--r--geo-replication/src/gsyncd.c6
-rw-r--r--geo-replication/src/peer_add_secret_pub3
-rw-r--r--geo-replication/src/peer_add_secret_pub.in9
-rw-r--r--geo-replication/syncdaemon/README.md2
-rw-r--r--geo-replication/syncdaemon/gsyncd.py7
-rw-r--r--geo-replication/syncdaemon/resource.py1
7 files changed, 21 insertions, 13 deletions
diff --git a/geo-replication/src/Makefile.am b/geo-replication/src/Makefile.am
index 6feeda8e6..324d8869f 100644
--- a/geo-replication/src/Makefile.am
+++ b/geo-replication/src/Makefile.am
@@ -3,9 +3,9 @@ gsyncddir = $(libexecdir)/glusterfs
gsyncd_SCRIPTS = gverify.sh peer_add_secret_pub peer_gsec_create
-# peer_gsec_create is not added to EXTRA_DIST as it's derived
-# from a .in file
-EXTRA_DIST = gverify.sh peer_add_secret_pub
+# peer_gsec_create and peer_add_secret_pub are not added to
+# EXTRA_DIST as it's derived from a .in file
+EXTRA_DIST = gverify.sh
gsyncd_PROGRAMS = gsyncd
diff --git a/geo-replication/src/gsyncd.c b/geo-replication/src/gsyncd.c
index 68446d9ad..0830e7f9b 100644
--- a/geo-replication/src/gsyncd.c
+++ b/geo-replication/src/gsyncd.c
@@ -37,7 +37,7 @@
#define _GLUSTERD_CALLED_ "_GLUSTERD_CALLED_"
#define _GSYNCD_DISPATCHED_ "_GSYNCD_DISPATCHED_"
-#define GSYNCD_CONF "geo-replication/gsyncd.conf"
+#define GSYNCD_CONF_TEMPLATE "geo-replication/gsyncd_template.conf"
#define GSYNCD_PY "gsyncd.py"
#define RSYNC "rsync"
@@ -127,11 +127,11 @@ invoke_gsyncd (int argc, char **argv)
gluster_workdir_len = len - 1;
if (gluster_workdir_len) {
- if (gluster_workdir_len + 1 + strlen (GSYNCD_CONF) + 1 >
+ if (gluster_workdir_len + 1 + strlen (GSYNCD_CONF_TEMPLATE) + 1 >
PATH_MAX)
goto error;
config_file[gluster_workdir_len] = '/';
- strcat (config_file, GSYNCD_CONF);
+ strcat (config_file, GSYNCD_CONF_TEMPLATE);
} else
goto error;
diff --git a/geo-replication/src/peer_add_secret_pub b/geo-replication/src/peer_add_secret_pub
deleted file mode 100644
index 1ce040d44..000000000
--- a/geo-replication/src/peer_add_secret_pub
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-cat $1 >> ~/.ssh/authorized_keys
diff --git a/geo-replication/src/peer_add_secret_pub.in b/geo-replication/src/peer_add_secret_pub.in
new file mode 100644
index 000000000..c036cf334
--- /dev/null
+++ b/geo-replication/src/peer_add_secret_pub.in
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [ ! -d ~/.ssh ]; then
+ mkdir ~/.ssh;
+ chmod 700 ~/.ssh
+ chown root:root ~/.ssh
+fi
+
+cat "$GLUSTERD_WORKING_DIR"/geo-replication/common_secret.pem.pub >> ~/.ssh/authorized_keys
diff --git a/geo-replication/syncdaemon/README.md b/geo-replication/syncdaemon/README.md
index 0eb15fa71..67f346ace 100644
--- a/geo-replication/syncdaemon/README.md
+++ b/geo-replication/syncdaemon/README.md
@@ -39,7 +39,7 @@ The config file format matches the following syntax:
<option2>: <value2>
# comment
-By default (unless specified by the option `-c`), gsyncd looks for config file at _conf/gsyncd.conf_
+By default (unless specified by the option `-c`), gsyncd looks for config file at _conf/gsyncd_template.conf_
in the source tree.
USAGE
diff --git a/geo-replication/syncdaemon/gsyncd.py b/geo-replication/syncdaemon/gsyncd.py
index ad498c39c..67ba07370 100644
--- a/geo-replication/syncdaemon/gsyncd.py
+++ b/geo-replication/syncdaemon/gsyncd.py
@@ -346,10 +346,9 @@ def main_i():
for name in rmap[x]:
for j in range(3):
namedict[mods[j](name)] = pa[j][i]
- if x.scheme == 'gluster':
- namedict[name + 'vol'] = x.volume
+ namedict[name + 'vol'] = x.volume
if not 'config_file' in rconf:
- rconf['config_file'] = os.path.join(os.path.dirname(sys.argv[0]), "conf/gsyncd.conf")
+ rconf['config_file'] = os.path.join(os.path.dirname(sys.argv[0]), "conf/gsyncd_template.conf")
gcnf = GConffile(rconf['config_file'], canon_peers, defaults.__dict__, opts.__dict__, namedict)
checkpoint_change = False
@@ -399,6 +398,8 @@ def main_i():
if getattr(gconf, 'state_socket_unencoded', None):
cleanup_paths.append(gconf.state_socket_unencoded)
+ cleanup_paths.append(rconf['config_file'][:-11] + "*");
+
# Cleanup changelog working dirs
if getattr(gconf, 'working_dir', None):
try:
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 52989fe28..4b0183b98 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -1056,6 +1056,7 @@ class SSH(AbstractUrl, SlaveRemote):
self.remote_addr, inner_url = sup(self, path,
'^((?:%s@)?%s):(.+)' % tuple([ r.pattern for r in (UserRX, HostRX) ]))
self.inner_rsc = parse_url(inner_url)
+ self.volume = inner_url[1:]
@staticmethod
def parse_ssh_address(addr):