diff options
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 7 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.h | 3 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.h | 4 |
4 files changed, 11 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 3010f6646fd..060f957e871 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -851,6 +851,7 @@ glusterd_op_stop_volume (gd1_mgmt_stage_op_req *req) glusterd_volinfo_t *volinfo = NULL; glusterd_brickinfo_t *brickinfo = NULL; xlator_t *this = NULL; + int32_t mybrick = 0; GF_ASSERT (req); @@ -872,12 +873,13 @@ glusterd_op_stop_volume (gd1_mgmt_stage_op_req *req) " for brick %s:%s", brickinfo->hostname, brickinfo->path); ret = glusterd_volume_stop_glusterfs - (volinfo, brickinfo); + (volinfo, brickinfo, mybrick); if (ret) { gf_log ("", GF_LOG_ERROR, "Unable to stop " "glusterfs, ret: %d", ret); goto out; } + mybrick++; } } diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 7c8a67ec30e..fb76d1f0305 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -701,7 +701,7 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, goto out; } - GLUSTERD_GET_BRICK_PIDFILE (pidfile, path, brickinfo->hostname); + GLUSTERD_GET_BRICK_PIDFILE (pidfile, path, brickinfo->hostname, count); snprintf (volfile, PATH_MAX, "%s/%s-%s-%d.vol", path, brickinfo->hostname, volinfo->volname, count); snprintf (cmd_str, 8192, "glusterfs -f %s -p %s", volfile, pidfile); @@ -713,7 +713,8 @@ out: int32_t glusterd_volume_stop_glusterfs (glusterd_volinfo_t *volinfo, - glusterd_brickinfo_t *brickinfo) + glusterd_brickinfo_t *brickinfo, + int32_t count) { int32_t ret = -1; xlator_t *this = NULL; @@ -732,7 +733,7 @@ glusterd_volume_stop_glusterfs (glusterd_volinfo_t *volinfo, priv = this->private; GLUSTERD_GET_VOLUME_DIR (path, volinfo, priv); - GLUSTERD_GET_BRICK_PIDFILE (pidfile, path, brickinfo->hostname); + GLUSTERD_GET_BRICK_PIDFILE (pidfile, path, brickinfo->hostname, count); file = fopen (pidfile, "r+"); diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h index 041ecca6769..39a0cdb197f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.h +++ b/xlators/mgmt/glusterd/src/glusterd-utils.h @@ -100,7 +100,8 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, int32_t glusterd_volume_stop_glusterfs (glusterd_volinfo_t *volinfo, - glusterd_brickinfo_t *brickinfo); + glusterd_brickinfo_t *brickinfo, + int32_t count); int32_t glusterd_volinfo_delete (glusterd_volinfo_t *volinfo); diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h index f140bd9f77e..5fccc0199bd 100644 --- a/xlators/mgmt/glusterd/src/glusterd.h +++ b/xlators/mgmt/glusterd/src/glusterd.h @@ -92,8 +92,8 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args); snprintf (path, PATH_MAX, "%s/vols/%s", priv->workdir,\ volinfo->volname); -#define GLUSTERD_GET_BRICK_PIDFILE(pidfile, volpath, hostname)\ - snprintf (pidfile, PATH_MAX, "%s/run/%s.pid", volpath, hostname); +#define GLUSTERD_GET_BRICK_PIDFILE(pidfile, volpath, hostname, count) \ + snprintf (pidfile, PATH_MAX, "%s/run/%s-%d.pid", volpath, hostname, count); int glusterd_probe_begin (rpcsvc_request_t *req, const char *hoststr, int port); |