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>
This commit is contained in:
parent
79b3e4111a
commit
05a9780c91
@ -755,6 +755,7 @@ init (xlator_t *this)
|
|||||||
char voldir [PATH_MAX] = {0,};
|
char voldir [PATH_MAX] = {0,};
|
||||||
char dirname [PATH_MAX];
|
char dirname [PATH_MAX];
|
||||||
char cmd_log_filename [PATH_MAX] = {0,};
|
char cmd_log_filename [PATH_MAX] = {0,};
|
||||||
|
char hooks_dir [PATH_MAX] = {0,};
|
||||||
int first_time = 0;
|
int first_time = 0;
|
||||||
char *mountbroker_root = NULL;
|
char *mountbroker_root = NULL;
|
||||||
|
|
||||||
@ -978,7 +979,8 @@ init (xlator_t *this)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
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);
|
ret = glusterd_store_create_hooks_directory (dirname);
|
||||||
if (-1 == ret) {
|
if (-1 == ret) {
|
||||||
gf_log (this->name, GF_LOG_CRITICAL,
|
gf_log (this->name, GF_LOG_CRITICAL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user