9f5ccc
From 72168245761592a2cd0ebec05dd9bd9bc00745ca Mon Sep 17 00:00:00 2001
9f5ccc
From: Amar Tumballi <amarts@redhat.com>
9f5ccc
Date: Wed, 13 Mar 2019 08:51:31 +0530
9f5ccc
Subject: [PATCH 330/335] mount.glusterfs: change the error message
9f5ccc
9f5ccc
In scenarios where a mount fails before creating log file, doesn't
9f5ccc
make sense to give message to 'check log file'. See below:
9f5ccc
9f5ccc
```
9f5ccc
ERROR: failed to create logfile "/var/log/glusterfs/mnt.log" (No space left on device)
9f5ccc
ERROR: failed to open logfile /var/log/glusterfs/mnt.log
9f5ccc
Mount failed. Please check the log file for more details.
9f5ccc
```
9f5ccc
9f5ccc
>upstream patch: https://review.gluster.org/#/c/glusterfs/+/22346/
9f5ccc
>Fixes: bz#1688068
9f5ccc
>Change-Id: I1d837caa4f9bc9f1a37780783e95007e01ae4e3f
9f5ccc
>Signed-off-by: Amar Tumballi <amarts@redhat.com>
9f5ccc
9f5ccc
BUG: 1685406
9f5ccc
Change-Id: I1d837caa4f9bc9f1a37780783e95007e01ae4e3f
9f5ccc
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
9f5ccc
Reviewed-on: https://code.engineering.redhat.com/gerrit/185828
9f5ccc
Tested-by: RHGS Build Bot <nigelb@redhat.com>
9f5ccc
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
9f5ccc
---
9f5ccc
 xlators/mount/fuse/utils/mount.glusterfs.in | 9 +++++++--
9f5ccc
 1 file changed, 7 insertions(+), 2 deletions(-)
9f5ccc
9f5ccc
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
9f5ccc
index 3f5d76d..cbde42d 100755
9f5ccc
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
9f5ccc
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
9f5ccc
@@ -361,7 +361,10 @@ start_glusterfs ()
9f5ccc
     cmd_line=$(echo "$cmd_line $mount_point");
9f5ccc
     $cmd_line;
9f5ccc
     if [ $? -ne 0 ]; then
9f5ccc
-        warn "Mount failed. Please check the log file for more details."
9f5ccc
+        # If this is true, then glusterfs process returned error without
9f5ccc
+        # getting daemonized. We have made sure the logs are posted to
9f5ccc
+        # 'stderr', so no need to point them to logfile.
9f5ccc
+        warn "Mounting glusterfs on $mount_point failed."
9f5ccc
         exit 1;
9f5ccc
     fi
9f5ccc
 
9f5ccc
@@ -369,7 +372,9 @@ start_glusterfs ()
9f5ccc
     inode=$( ${getinode} $mount_point 2>/dev/null);
9f5ccc
     # this is required if the stat returns error
9f5ccc
     if [ $? -ne 0 ]; then
9f5ccc
-        warn "Mount failed. Please check the log file for more details."
9f5ccc
+        # At this time, glusterfs got daemonized, and then later exited.
9f5ccc
+        # These failures are only logged in log file.
9f5ccc
+        warn "Mount failed. Check the log file ${log_file} for more details."
9f5ccc
         umount $mount_point > /dev/null 2>&1;
9f5ccc
         exit 1;
9f5ccc
     fi
9f5ccc
-- 
9f5ccc
1.8.3.1
9f5ccc