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