summaryrefslogtreecommitdiffstats
path: root/extras/hook-scripts/start/post
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@redhat.com>2018-03-21 13:09:01 +0530
committerPoornima G <pgurusid@redhat.com>2018-05-07 05:04:04 +0000
commit33131131469e18d3ebbdc6ce741c2984dc77b290 (patch)
tree73bba692f1ee157568e7a2e1b7f3a5c7478915dc /extras/hook-scripts/start/post
parenta6490fe02174d344f4ed81fa3bc6c0b5933f4faf (diff)
extras/hooks: Do not blindly remove volume share from smb.conf
When Gluster volumes are shared via Samba, any extra smb.conf parameter setting done by administrator to those shares are lost during restart of the volume. Instead of removing the whole share completely from smb.conf(via hook scripts during volume stop) it is better to make it temporarily unavailable to end-users till the volume is started again. Therefore we make use of a smb.conf parameter named 'available'[1] to achieve the above intend. [1] https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html Change-Id: I68a9055b50791f6ffd3b95a3c13d858a75fa6530 fixes: bz#1558921 BUG: 1558921 Signed-off-by: Anoop C S <anoopcs@redhat.com>
Diffstat (limited to 'extras/hook-scripts/start/post')
-rwxr-xr-xextras/hook-scripts/start/post/S30samba-start.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/extras/hook-scripts/start/post/S30samba-start.sh b/extras/hook-scripts/start/post/S30samba-start.sh
index 92ddaf4e37f..5d586ee9fae 100755
--- a/extras/hook-scripts/start/post/S30samba-start.sh
+++ b/extras/hook-scripts/start/post/S30samba-start.sh
@@ -127,5 +127,7 @@ find_config_info
if ! grep --quiet "\[gluster-$VOL\]" ${CONFIGFILE} ; then
add_samba_share $VOL
- sighup_samba
+else
+ sed -i '/\[gluster-'"$VOL"'\]/,/^$/!b;/available = no/d' ${CONFIGFILE}
fi
+sighup_samba