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-22 01:56:59 -0700
commitbc6d9d679a87dd980afa4a064d6b2f6c49f39cae (patch)
tree173250ddc9f395bfb7efa9a0ef4762f5fe9b3e6f /extras
parentd9e688e42a9b1e4be221fed9c1c85db0c2ae3664 (diff)
gluster/shared_storage: Add/Remove shared storage from /etc/fstab during enable/disable
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: 1231876 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/11272 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
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