diff options
-rw-r--r-- | extras/hook-scripts/start/post/S30samba-start.sh | 19 | ||||
-rw-r--r-- | extras/hook-scripts/stop/pre/S30samba-stop.sh (renamed from extras/hook-scripts/start/post/S30samba-stop.sh) | 9 |
2 files changed, 4 insertions, 24 deletions
diff --git a/extras/hook-scripts/start/post/S30samba-start.sh b/extras/hook-scripts/start/post/S30samba-start.sh index 5c7b6574e36..60c192aad08 100644 --- a/extras/hook-scripts/start/post/S30samba-start.sh +++ b/extras/hook-scripts/start/post/S30samba-start.sh @@ -1,11 +1,8 @@ #!/bin/bash -#Need to be copied to hooks/<HOOKS_VER>/start/post PROGNAME="Ssamba-start" -OPTSPEC="volname:,mnt:" +OPTSPEC="volname:" VOL= -#FIXME: glusterd hook interface will eventually provide mntpt prefix as -# command line arg MNT_PRE="/mnt/samba" function parse_args () { @@ -18,10 +15,6 @@ function parse_args () { shift VOL=$1 ;; - --mnt) - shift - MNT_PRE=$1 - ;; *) shift break @@ -38,13 +31,6 @@ function add_samba_export () { printf "\n[gluster-$volname]\ncomment=For samba export of volume $volname\npath=$mnt_pre/$volname\nread only=no\nguest ok=yes\n" >> /etc/samba/smb.conf } -function mount_volume () { - volname=$1 - mnt_pre=$2 - #Mount shouldn't block on glusterd to fetch volfile, hence the 'bg' - mount -t glusterfs `hostname`:$volname $mnt_pre/$volname & -} - function sighup_samba () { pid=`cat /var/run/smbd.pid` if [ $pid != " " ] @@ -58,5 +44,6 @@ function sighup_samba () { parse_args $@ add_samba_export $VOL $MNT_PRE -mount_volume $VOL $MNT_PRE +sleep 5 +mount -t glusterfs `hostname`:$volname $mnt_pre/$volname sighup_samba diff --git a/extras/hook-scripts/start/post/S30samba-stop.sh b/extras/hook-scripts/stop/pre/S30samba-stop.sh index 0886f91bf9d..783171a437e 100644 --- a/extras/hook-scripts/start/post/S30samba-stop.sh +++ b/extras/hook-scripts/stop/pre/S30samba-stop.sh @@ -1,10 +1,8 @@ #! /bin/bash -#Need to be copied to hooks/<HOOKS_VER>/stop/post PROGNAME="Ssamba-stop" -OPTSPEC="volname:,mnt:" +OPTSPEC="volname:" VOL= -#FIXME: gluster will eventually pass mnt prefix as command line argument MNT_PRE="/mnt/samba" function parse_args () { @@ -17,11 +15,6 @@ function parse_args () { shift VOL=$1 ;; - --mnt) - shift - MNT_PRE=$1 - echo $1 - ;; *) shift break |