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