From 11bb1fc5849a557d1a26e59bd651fbd0d07a1b8d Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Mon, 7 Oct 2013 13:08:49 +0530 Subject: extras/hookscripts: Fix the multiple entries in smb.conf problem. Problem: 1. Force starts and user.smb sets were adding multiple entries to the smb.conf file for the same volume. Make a check for the entry and search with exact name. 2. Again, while deleting the share name from smb.conf search with exact name so that volumes with names which are substrings of ones to be deleted don't get deleted. 3. We don't need to use a tmp file while using sed -i, fixed that. Change-Id: Ie0f7c9d4790ef9a177a043378a761c9ffe1628e5 BUG: 994727 Signed-off-by: Raghavendra Talur Reviewed-on: http://review.gluster.org/6043 Reviewed-by: Niels de Vos Reviewed-by: Lalatendu Mohanty Tested-by: Lalatendu Mohanty --- extras/hook-scripts/S30samba-start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'extras/hook-scripts/S30samba-start.sh') diff --git a/extras/hook-scripts/S30samba-start.sh b/extras/hook-scripts/S30samba-start.sh index 191b1dbb4..9f1b20a25 100755 --- a/extras/hook-scripts/S30samba-start.sh +++ b/extras/hook-scripts/S30samba-start.sh @@ -73,7 +73,7 @@ function add_samba_share () { function sighup_samba () { pid=`cat ${PIDDIR}/smbd.pid` - if [ "$pid" != "" ] + if [ "x$pid" != "x" ] then kill -HUP "$pid"; else @@ -104,7 +104,7 @@ fi #Find smb.conf, smbd pid directory and smbd logfile path find_config_info -if ! grep --quiet "gluster-$VOL" ${CONFIGFILE} ; then +if ! grep --quiet "\[gluster-$VOL\]" ${CONFIGFILE} ; then add_samba_share $VOL sighup_samba fi -- cgit