diff options
| -rwxr-xr-x | extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh | 2 | ||||
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 9 | ||||
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.c | 10 | ||||
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.h | 8 | 
4 files changed, 12 insertions, 17 deletions
diff --git a/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh b/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh index 68bc44d2e05..90802196b40 100755 --- a/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh +++ b/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh @@ -74,7 +74,7 @@ create_cmd="gluster --mode=script --wignore volume create \  # Adding the brick names in the command  for i in "${connected_peer[@]}"  do -    create_cmd=$create_cmd" "$i:/var/run/gluster/ss_brick +    create_cmd=$create_cmd" "$i:"$GLUSTERD_WORKDIR"/ss_brick  done  if [ "$option" == "disable" ]; then diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 859019e0d5f..9076aa8b5f6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -55,7 +55,6 @@  #include <signal.h>  #include <sys/wait.h> -extern char ss_brick_path[PATH_MAX];  extern char local_node_hostname[PATH_MAX];  static int  glusterd_set_shared_storage (dict_t *dict, char *key, char *value, @@ -2295,12 +2294,12 @@ glusterd_set_shared_storage (dict_t *dict, char *key, char *value,          /* Re-create the brick path so as to be *           * able to re-use it                    *           */ -        ret = recursive_rmdir (ss_brick_path); +        ret = recursive_rmdir (GLUSTER_SHARED_STORAGE_BRICK_DIR);          if (ret) {                  snprintf (errstr, PATH_MAX,                            "Failed to remove shared "                            "storage brick(%s). " -                          "Reason: %s", ss_brick_path, +                          "Reason: %s", GLUSTER_SHARED_STORAGE_BRICK_DIR,                            strerror (errno));                  gf_msg (this->name, GF_LOG_ERROR, errno,                          GD_MSG_DIR_OP_FAILED, "%s", errstr); @@ -2308,12 +2307,12 @@ glusterd_set_shared_storage (dict_t *dict, char *key, char *value,                  goto out;          } -        ret = mkdir_p (ss_brick_path, 0777, _gf_true); +        ret = mkdir_p (GLUSTER_SHARED_STORAGE_BRICK_DIR, 0777, _gf_true);          if (-1 == ret) {                  snprintf (errstr, PATH_MAX,                            "Failed to create shared "                            "storage brick(%s). " -                          "Reason: %s", ss_brick_path, +                          "Reason: %s", GLUSTER_SHARED_STORAGE_BRICK_DIR,                            strerror (errno));                  gf_msg (this->name, GF_LOG_ERROR, errno,                          GD_MSG_CREATE_DIR_FAILED, "%s", errstr); diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index 42037056263..9754e8bf874 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -68,7 +68,6 @@ extern struct rpc_clnt_program gd_brick_prog;  extern struct rpcsvc_program glusterd_mgmt_hndsk_prog;  extern char snap_mount_dir[PATH_MAX]; -char ss_brick_path[PATH_MAX];  rpcsvc_cbk_program_t glusterd_cbk_prog = {          .progname  = "Gluster Callback", @@ -1445,18 +1444,15 @@ init (xlator_t *this)          snprintf (snap_mount_dir, sizeof(snap_mount_dir), "%s%s",                    var_run_dir, GLUSTERD_DEFAULT_SNAPS_BRICK_DIR); -        ret = glusterd_init_var_run_dirs (this, var_run_dir, -                                      GLUSTER_SHARED_STORAGE_BRICK_DIR); +        ret = mkdir_p (GLUSTER_SHARED_STORAGE_BRICK_DIR, 0777, +                       _gf_true);          if (ret) {                  gf_msg (this->name, GF_LOG_CRITICAL, 0, -                        GD_MSG_VAR_RUN_DIR_INIT_FAIL, "Unable to create " +                        GD_MSG_DIR_OP_FAILED, "Unable to create "                          "shared storage brick");                  exit (1);          } -        snprintf (ss_brick_path, sizeof(ss_brick_path), "%s%s", -                  var_run_dir, GLUSTER_SHARED_STORAGE_BRICK_DIR); -          snprintf (cmd_log_filename, PATH_MAX, "%s/cmd_history.log",                    DEFAULT_LOG_FILE_DIRECTORY);          ret = gf_cmd_log_init (cmd_log_filename); diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index cfe7a7b1fd7..c72c5690a79 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -513,10 +513,10 @@ typedef enum {  #define GLUSTERD_MISSED_SNAPS_LIST_FILE "missed_snaps_list"  #define GLUSTERD_VOL_SNAP_DIR_PREFIX "snaps" -#define GLUSTERD_DEFAULT_SNAPS_BRICK_DIR        "/gluster/snaps" -#define GLUSTER_SHARED_STORAGE_BRICK_DIR        "/gluster/ss_brick" -#define GLUSTERD_VAR_RUN_DIR                    "/var/run" -#define GLUSTERD_RUN_DIR                        "/run" +#define GLUSTERD_DEFAULT_SNAPS_BRICK_DIR     "/gluster/snaps" +#define GLUSTER_SHARED_STORAGE_BRICK_DIR     GLUSTERD_DEFAULT_WORKDIR"/ss_brick" +#define GLUSTERD_VAR_RUN_DIR                 "/var/run" +#define GLUSTERD_RUN_DIR                     "/run"  /* definitions related to replace brick */  #define RB_CLIENT_MOUNTPOINT    "rb_mount"  | 
