From 1969ef17591342af2148d3a740b368f8cc6f8d5d Mon Sep 17 00:00:00 2001 From: Rajesh Amaravathi Date: Wed, 1 Feb 2012 15:52:36 +0530 Subject: mount/fuse: check for existence of volfiles If glusterd is not running in the client host and/or if there are no volume created yet, this patch ensures that appropriate error message is displayed Change-Id: I15d23a45d70aa27bbdd42f435fe705b14c779e3f BUG: 786077 Signed-off-by: Rajesh Amaravathi Reviewed-on: http://review.gluster.com/2708 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/mount/fuse/utils/mount.glusterfs.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 40bf48150..40fd5781e 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -192,7 +192,7 @@ check_recursive_mount () export PATH; # check whether getfattr exists - which getfattr > /dev/null; + which getfattr > /dev/null 2>&1; if [ $? -ne 0 ]; then return; fi @@ -204,7 +204,14 @@ check_recursive_mount () fi # check if the mount point is a brick's parent directory - brick_path=(`cat /etc/glusterd/vols/*/bricks/* | grep ^path | cut -d "=" -f 2`); + GLUSTERD_WORKDIR="/etc/glusterd"; + + ls -L "$GLUSTERD_WORKDIR"/vols/*/bricks/* > /dev/null 2>&1; + if [ $? -ne 0 ]; then + return; + fi + + brick_path=(`grep ^path "$GLUSTERD_WORKDIR"/vols/*/bricks/* | cut -d "=" -f 2`); root_inode=`stat -Lc %i /`; root_dev=`stat -Lc %d /`; mnt_inode=`stat -Lc %i $mnt_dir`; -- cgit