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