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