summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-21 01:53:42 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-21 05:17:32 -0700
commitad0e7a86c256b6e49daddafd954809b6040804b2 (patch)
tree058a454d2944376b1091fa9b8e772f98d74c6a61 /xlators/mgmt
parentdaf868e13511d97492ca4ece5fe60a2a4f69a20f (diff)
glusterd: prefix added to gluster commands
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1283 ([3.1.0qa3] gluster volume create and volume start fail on when glusterfs is installed on prefixed path) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1283
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/Makefile.am3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c28
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c4
4 files changed, 22 insertions, 17 deletions
diff --git a/xlators/mgmt/glusterd/src/Makefile.am b/xlators/mgmt/glusterd/src/Makefile.am
index db5b9faeb03..29733d0bd09 100644
--- a/xlators/mgmt/glusterd/src/Makefile.am
+++ b/xlators/mgmt/glusterd/src/Makefile.am
@@ -15,6 +15,7 @@ noinst_HEADERS = glusterd.h glusterd-utils.h glusterd-op-sm.h glusterd-sm.h \
AM_CFLAGS = -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall -D$(GF_HOST_OS)\
-I$(top_srcdir)/libglusterfs/src -shared -nostartfiles $(GF_CFLAGS)\
-I$(rpclibdir) -L$(xlatordir)/ -I$(CONTRIBDIR)/rbtree -I$(top_srcdir)/rpc/xdr/src\
- -I$(top_srcdir)/rpc/rpc-lib/src -I$(CONTRIBDIR)/uuid
+ -I$(top_srcdir)/rpc/rpc-lib/src -I$(CONTRIBDIR)/uuid -DGFS_PREFIX=\"$(prefix)\"
+
CLEANFILES =
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 64db68fa230..7e9a82e306a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -863,10 +863,10 @@ glusterd_handle_defrag_volume (rpcsvc_request_t *req)
goto out;
}
- snprintf (cmd_str, 4096, "glusterfs -f %s/vols/%s/%s-tcp.vol "
+ snprintf (cmd_str, 4096, "%s/sbin/glusterfs -f %s/vols/%s/%s-tcp.vol "
"--xlator-option dht0.unhashed-sticky-bit=yes "
"--xlator-option dht0.lookup-unhashed=yes "
- "--volume-name quickread %s",
+ "--volume-name quickread %s", GFS_PREFIX,
priv->workdir, cli_req.volname, cli_req.volname,
defrag->mount);
ret = system (cmd_str);
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 2419fa3b916..d24a4f15994 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -290,34 +290,36 @@ glusterd_volume_create_generate_volfiles (glusterd_volinfo_t *volinfo)
case GF_CLUSTER_TYPE_REPLICATE:
{
snprintf (cmd_str, 8192,
- "glusterfs-volgen --portmapper-mode -n %s "
+ "%s/bin/glusterfs-volgen --portmapper-mode -n %s "
" -c %s -r 1 %s -p %d --num-replica %d",
- volinfo->volname, path, bricks,
+ GFS_PREFIX, volinfo->volname, path, bricks,
volinfo->port, volinfo->sub_count);
ret = system (cmd_str);
+ gf_log ("", 1, "%s", cmd_str);
break;
}
case GF_CLUSTER_TYPE_STRIPE:
{
snprintf (cmd_str, 8192,
- "glusterfs-volgen --portmapper-mode -n %s "
+ "%s/bin/glusterfs-volgen --portmapper-mode -n %s "
" -c %s -r 0 %s -p %d --num-stripe %d",
- volinfo->volname, path, bricks,
+ GFS_PREFIX, volinfo->volname, path, bricks,
volinfo->port, volinfo->sub_count);
ret = system (cmd_str);
+ gf_log ("", 1, "%s", cmd_str);
break;
}
case GF_CLUSTER_TYPE_NONE:
{
snprintf (cmd_str, 8192,
- "glusterfs-volgen --portmapper-mode -n %s "
- " -c %s %s -p %d",
- volinfo->volname, path, bricks,
+ "%s/bin/glusterfs-volgen --portmapper-mode "
+ " -n %s -c %s %s -p %d",
+ GFS_PREFIX, volinfo->volname, path, bricks,
volinfo->port);
- gf_log ("", 1, "%s", cmd_str);
ret = system (cmd_str);
+ gf_log ("", 1, "%s", cmd_str);
break;
}
@@ -1004,8 +1006,9 @@ rb_spawn_dst_brick (glusterd_volinfo_t *volinfo,
priv = THIS->private;
- snprintf (cmd_str, 8192, "glusterfs -f %s/vols/%s/%s -p %s/vols/%s/%s",
- priv->workdir, volinfo->volname,
+ snprintf (cmd_str, 8192,
+ "%s/sbin/glusterfs -f %s/vols/%s/%s -p %s/vols/%s/%s",
+ GFS_PREFIX, priv->workdir, volinfo->volname,
RB_DSTBRICKVOL_FILENAME,
priv->workdir, volinfo->volname,
RB_DSTBRICK_PIDFILE);
@@ -1038,8 +1041,9 @@ rb_spawn_glusterfs_client (glusterd_volinfo_t *volinfo,
priv = THIS->private;
- snprintf (cmd_str, 4096, "glusterfs -f %s/vols/%s/%s %s/vols/%s/%s",
- priv->workdir, volinfo->volname,
+ snprintf (cmd_str, 4096,
+ "%s/sbin/glusterfs -f %s/vols/%s/%s %s/vols/%s/%s",
+ GFS_PREFIX, priv->workdir, volinfo->volname,
RB_CLIENTVOL_FILENAME,
priv->workdir, volinfo->volname,
RB_CLIENT_MOUNTPOINT);
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 4202f271638..424c35f2f71 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -767,9 +767,9 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo,
volinfo->volname, count);
snprintf (cmd_str, 8192,
- "glusterfs --xlator-option server-*.listen-port=%d "
+ "%s/sbin/glusterfs --xlator-option server-*.listen-port=%d "
"-s localhost --volfile-id %s -p %s --brick-name %s "
- "--brick-port %d",
+ "--brick-port %d", GFS_PREFIX,
port, volfile, pidfile, brickinfo->path, port);
ret = system (cmd_str);