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