From 05a9780c9111396f4e2c3ebdae77cf8a257f1a54 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Mon, 9 Apr 2012 21:27:40 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/3111 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index b84c141df9a..b1856d81d98 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, -- cgit