summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2012-04-09 21:27:40 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-09 09:23:14 -0700
commit05a9780c9111396f4e2c3ebdae77cf8a257f1a54 (patch)
tree039172b5d6966e3e956190ed21a33613d3962bb3
parent79b3e4111a1a64dc74046571845b3ed83b8ede24 (diff)
glusterd: Modified algo for creating hooks directories.
- This change will ensure that hooks directories are created when glusterd is upgraded from a version that doesn't have the hooks feature or the 'current' hooks version. Change-Id: I8a0ea64eda52a15b1605b98588b9b19df209a73e BUG: 806996 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/3111 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index b84c141df..b1856d81d 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -755,6 +755,7 @@ init (xlator_t *this)
char voldir [PATH_MAX] = {0,};
char dirname [PATH_MAX];
char cmd_log_filename [PATH_MAX] = {0,};
+ char hooks_dir [PATH_MAX] = {0,};
int first_time = 0;
char *mountbroker_root = NULL;
@@ -978,7 +979,8 @@ init (xlator_t *this)
if (ret < 0)
goto out;
- if (first_time) {
+ GLUSTERD_GET_HOOKS_DIR (hooks_dir, GLUSTERD_HOOK_VER, conf);
+ if (stat (hooks_dir, &buf)) {
ret = glusterd_store_create_hooks_directory (dirname);
if (-1 == ret) {
gf_log (this->name, GF_LOG_CRITICAL,