summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/hook-scripts/Makefile.am3
-rw-r--r--glusterfs.spec.in4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c19
3 files changed, 13 insertions, 13 deletions
diff --git a/extras/hook-scripts/Makefile.am b/extras/hook-scripts/Makefile.am
index 4a1adb3d5db..fa126f90591 100644
--- a/extras/hook-scripts/Makefile.am
+++ b/extras/hook-scripts/Makefile.am
@@ -1,2 +1,5 @@
EXTRA_DIST = S40ufo-stop.py S56glusterd-geo-rep-create-post.sh
SUBDIRS = add-brick set start stop reset
+
+scriptsdir = $(GLUSTERD_WORKDIR)/hooks/1/gsync-create/post/
+scripts_SCRIPTS = S56glusterd-geo-rep-create-post.sh
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 9390bb24137..53b0c8ed602 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -711,10 +711,6 @@ mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/nfs/run
touch %{buildroot}%{_sharedstatedir}/glusterd/nfs/nfs-server.vol
touch %{buildroot}%{_sharedstatedir}/glusterd/nfs/run/nfs.pid
-%if ( 0%{!?_without_georeplication:1} )
-install -p -m 0744 extras/hook-scripts/S56glusterd-geo-rep-create-post.sh \
- %{buildroot}%{_sharedstatedir}/glusterd/hooks/1/gsync-create/post
-%endif
%{__install} -p -m 0744 extras/hook-scripts/start/post/*.sh \
%{buildroot}%{_sharedstatedir}/glusterd/hooks/1/start/post
%{__install} -p -m 0744 extras/hook-scripts/stop/pre/*.sh \
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index dc4293dcc07..550cae456a3 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -1258,7 +1258,6 @@ init (xlator_t *this)
struct stat buf = {0,};
char storedir [PATH_MAX] = {0,};
char workdir [PATH_MAX] = {0,};
- char hooks_dir [PATH_MAX] = {0,};
char cmd_log_filename [PATH_MAX] = {0,};
int first_time = 0;
char *mountbroker_root = NULL;
@@ -1593,14 +1592,16 @@ init (xlator_t *this)
glusterd_mgmt_v3_lock_init ();
glusterd_txn_opinfo_dict_init ();
- GLUSTERD_GET_HOOKS_DIR (hooks_dir, GLUSTERD_HOOK_VER, conf);
- if (stat (hooks_dir, &buf)) {
- ret = glusterd_hooks_create_hooks_directory (conf->workdir);
- if (-1 == ret) {
- gf_log (this->name, GF_LOG_CRITICAL,
- "Unable to create hooks directory ");
- exit (1);
- }
+ /* Make install copies few of the hook-scripts by creating hooks
+ * directory. Hence purposefully not doing the check for the presence of
+ * hooks directory. Doing so avoids creation of complete hooks directory
+ * tree.
+ */
+ ret = glusterd_hooks_create_hooks_directory (conf->workdir);
+ if (-1 == ret) {
+ gf_log (this->name, GF_LOG_CRITICAL,
+ "Unable to create hooks directory ");
+ exit (1);
}
CDS_INIT_LIST_HEAD (&conf->mount_specs);