summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-06-17 15:00:23 +0530
committerRajesh Joseph <rjoseph@redhat.com>2015-06-24 02:13:14 -0700
commit1fc5308f1157fe1cbcd60313e09d66be71c2d051 (patch)
tree67ad143b93c0c507a4d5c65f6cb05946b65a50cb /extras
parent2c541e1872df1f87c6946d33316228cbf332a3db (diff)
gluster/shared_storage: Add/Remove shared storage from /etc/fstab during enable/disable
Backport of http://review.gluster.org/#/c/11272/ While creating/deleting shared storage volume, add/remove the shared storage entry from /etc/fstab, so as to ensure availability of the shared storage, even after a node reboot Change-Id: Ib9edc8fd02c74a677062ca53ffd10be997b056c6 BUG: 1232889 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/11295 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'extras')
-rwxr-xr-xextras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh b/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh
index 28fa0e53316..68bc44d2e05 100755
--- a/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh
+++ b/extras/hook-scripts/set/post/S32gluster_enable_shared_storage.sh
@@ -80,6 +80,8 @@ done
if [ "$option" == "disable" ]; then
# Unmount the volume on all the nodes
umount /var/run/gluster/shared_storage
+ cat /etc/fstab | grep -v "gluster_shared_storage /var/run/gluster/shared_storage/" > /var/run/gluster/fstab.tmp
+ mv /var/run/gluster/fstab.tmp /etc/fstab
fi
if [ "$is_originator" == 1 ]; then
@@ -121,4 +123,7 @@ if [ "$option" == "enable" ]; then
umount /var/run/gluster/shared_storage
mkdir -p /var/run/gluster/shared_storage
$mount_cmd
+ cp /etc/fstab /var/run/gluster/fstab.tmp
+ echo "$local_node_hostname:/gluster_shared_storage /var/run/gluster/shared_storage/ glusterfs defaults 0 0" >> /var/run/gluster/fstab.tmp
+ mv /var/run/gluster/fstab.tmp /etc/fstab
fi