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