summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in28
1 files changed, 20 insertions, 8 deletions
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
index 6b683dc91c2..01a403c0a02 100755
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
@@ -27,8 +27,6 @@ _init ()
LOG_DEBUG=DEBUG;
LOG_TRACE=TRACE;
- # set default log level to INFO
- log_level=$LOG_INFO;
prefix="@prefix@";
exec_prefix=@exec_prefix@;
cmd_line=$(echo "@sbindir@/glusterfs");
@@ -67,7 +65,9 @@ start_glusterfs ()
;;
esac
fi
- cmd_line=$(echo "$cmd_line --log-level=$log_level");
+ if [ -n "$log_level" ]; then
+ cmd_line=$(echo "$cmd_line --log-level=$log_level");
+ fi
if [ -n "$read_only" ]; then
cmd_line=$(echo "$cmd_line --read-only");
@@ -127,13 +127,28 @@ start_glusterfs ()
err=0;
$cmd_line;
+
+ inode=$(stat -c %i $mount_point 2>/dev/null);
+
+ # this is required if the stat returns error
+ if [ -z "$inode" ]; then
+ inode="0";
+ fi
+
# retry the failover
- if [ $? != "0" ]; then
+ # if [ $? != "0" ]; then # <--- TODO: Once glusterfs returns proper error code, change it.
+ if [ $inode -ne 1 ]; then
err=1;
if [ -n "$cmd_line1" ]; then
cmd_line1=$(echo "$cmd_line1 $mount_point");
$cmd_line1
- if [ $? != "0"]; then
+
+ inode=$(stat -c %i $mount_point 2>/dev/null);
+ # this is required if the stat returns error
+ if [ -z "$inode" ]; then
+ inode="0";
+ fi
+ if [ $inode -ne 1]; then
err=1;
fi
fi
@@ -243,7 +258,6 @@ main ()
if grep -q " $mount_point fuse" /etc/mtab; then
echo -n "$0: according to mtab, GlusterFS is already mounted on "
echo "$mount_point"
- sleep 1;
exit 0;
fi
@@ -261,8 +275,6 @@ main ()
}
start_glusterfs;
-
- sleep 3;
}
_init "$@" && main "$@";