190130
From ccd45222c46b91b4d0cd57db9ea8b1515c97ada0 Mon Sep 17 00:00:00 2001
190130
From: Shwetha K Acharya <sacharya@redhat.com>
190130
Date: Mon, 31 Aug 2020 20:08:39 +0530
190130
Subject: [PATCH 472/473] geo-rep: gluster_shared_storage fails to automount on
190130
 node reboot on rhel 8.
190130
190130
Issue: On reboot, all the mounts get wiped out.
190130
       Only the mounts mentioned in /etc/fstab  automatically gets mounted
190130
       during boot/reboot.
190130
190130
       But /etc/fstab complains on not getting a canonical path
190130
       (it gets path containing a symlink)
190130
       This is because the gluster_shared_storage, is mounted to
190130
       /var/run which is symlink to /run. This is a general practice
190130
       followed by most operating systems.
190130
190130
       [root@ ~]# ls -lsah /var/run
190130
       0 lrwxrwxrwx. 1 root root 6 Jul 22 19:39 /var/run -> ../run
190130
190130
Fix:   Mount gluster_shared_storage on /run.
190130
       (Also It is seen that /var/run is mostly
190130
       used by old or legacy systems, thus it is a good practice to
190130
       update /var/run to /run)
190130
190130
>fixes: #1459
190130
>Change-Id: I8c16653be8cd746c84f01abf0eea19284fb97c77
190130
>Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
190130
190130
backport of https://review.gluster.org/#/c/glusterfs/+/24934/
190130
BUG: 1873469
190130
Change-Id: I8c16653be8cd746c84f01abf0eea19284fb97c77
190130
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
190130
Reviewed-on: https://code.engineering.redhat.com/gerrit/211387
190130
Tested-by: RHGS Build Bot <nigelb@redhat.com>
190130
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
190130
---
190130
 .../set/post/S32gluster_enable_shared_storage.sh       | 18 +++++++++---------
190130
 geo-replication/gsyncd.conf.in                         |  2 +-
190130
 2 files changed, 10 insertions(+), 10 deletions(-)
190130
190130
diff --git a/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh b/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh
190130
index 885ed03..3bae37c 100755
190130
--- a/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh
190130
+++ b/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh
190130
@@ -79,9 +79,9 @@ done
190130
 
190130
 if [ "$option" == "disable" ]; then
190130
     # Unmount the volume on all the nodes
190130
-    umount /var/run/gluster/shared_storage
190130
-    cat /etc/fstab  | grep -v "gluster_shared_storage /var/run/gluster/shared_storage/" > /var/run/gluster/fstab.tmp
190130
-    mv /var/run/gluster/fstab.tmp /etc/fstab
190130
+    umount /run/gluster/shared_storage
190130
+    cat /etc/fstab  | grep -v "gluster_shared_storage /run/gluster/shared_storage/" > /run/gluster/fstab.tmp
190130
+    mv /run/gluster/fstab.tmp /etc/fstab
190130
 fi
190130
 
190130
 if [ "$is_originator" == 1 ]; then
190130
@@ -105,7 +105,7 @@ function check_volume_status()
190130
 }
190130
 
190130
 mount_cmd="mount -t glusterfs $local_node_hostname:/gluster_shared_storage \
190130
-           /var/run/gluster/shared_storage"
190130
+           /run/gluster/shared_storage"
190130
 
190130
 if [ "$option" == "enable" ]; then
190130
     retry=0;
190130
@@ -120,10 +120,10 @@ if [ "$option" == "enable" ]; then
190130
         status=$(check_volume_status)
190130
     done
190130
     # Mount the volume on all the nodes
190130
-    umount /var/run/gluster/shared_storage
190130
-    mkdir -p /var/run/gluster/shared_storage
190130
+    umount /run/gluster/shared_storage
190130
+    mkdir -p /run/gluster/shared_storage
190130
     $mount_cmd
190130
-    cp /etc/fstab /var/run/gluster/fstab.tmp
190130
-    echo "$local_node_hostname:/gluster_shared_storage /var/run/gluster/shared_storage/ glusterfs defaults        0 0" >> /var/run/gluster/fstab.tmp
190130
-    mv /var/run/gluster/fstab.tmp /etc/fstab
190130
+    cp /etc/fstab /run/gluster/fstab.tmp
190130
+    echo "$local_node_hostname:/gluster_shared_storage /run/gluster/shared_storage/ glusterfs defaults        0 0" >> /run/gluster/fstab.tmp
190130
+    mv /run/gluster/fstab.tmp /etc/fstab
190130
 fi
190130
diff --git a/geo-replication/gsyncd.conf.in b/geo-replication/gsyncd.conf.in
190130
index 11e57fd..9688c79 100644
190130
--- a/geo-replication/gsyncd.conf.in
190130
+++ b/geo-replication/gsyncd.conf.in
190130
@@ -123,7 +123,7 @@ type=bool
190130
 help=Use this to set Active Passive mode to meta-volume.
190130
 
190130
 [meta-volume-mnt]
190130
-value=/var/run/gluster/shared_storage
190130
+value=/run/gluster/shared_storage
190130
 help=Meta Volume or Shared Volume mount path
190130
 
190130
 [allow-network]
190130
-- 
190130
1.8.3.1
190130