From 4a339be28a715aa22d8d07b3137920edea8a1c4a Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Mon, 30 Mar 2015 17:44:50 +0530 Subject: geo-rep: Copy geo-rep hook-script during source install The hook-script S56glusterd-geo-rep-create-post.sh was not copying to glusterd working directory when geo-rep is installed through source. Hence the geo-rep create fails unless the script is manually copied. This patch addresses the issue by copying the hook-script during make install. Change-Id: I185a877ed720e8300f0e888ab481d0c8c23bf815 BUG: 1207201 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/10051 Reviewed-by: Aravinda VK Reviewed-by: Niels de Vos Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd.c') 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); -- cgit