Configuration
[Gfarm] path = /tmp/gfarm/%u create mask = 0644 read only = no |
See Samba documentations about the details of Samba configurations.
/etc/fuse.conf
user_allow_other |
This allows users to specify the -o allow_root or -o allow_other option.
$ gfarm2fs [Gfarm2FS options] mountpoint [FUSE options] |
This mountpoint must be published by Samba. (See section 3)
This also assume the shared secret key is distributed correctly, or a valid proxy certificate exists on the samba machine.
[Gfarm] path = %H/samba-fuse exec = /usr/local/bin/gfarmfsmount.sh %P preexec close = Yes postexec = /usr/local/bin/gfarmfsumount.sh %P read only = no |
gfarmfsmount.sh
#! /bin/sh GFARMFS=/usr/local/bin/gfarm2fs USERNAME=`/usr/bin/whoami` LOGFILE=/tmp/gfarm2fs-$USERNAME.log #ARCH="-a i686-FC3-linux" ALLOWROOT="-o allow_root" GREP=/bin/grep DF=/bin/df TAIL=/usr/bin/tail DATE=/bin/date # for fusermount export PATH=$PATH:/usr/local/bin ##### if [ $# -ne 1 ]; then echo "usage: `basename $0` MOUNTPOINT" exit 1 fi if [ ! -f $LOGFILE ]; then touch $LOGFILE chmod 600 $LOGFILE fi DATE=`$DATE '+%Y%m%d-%H%M%S'` MOUNTP=$1 ($DF -t fuse $MOUNTP | $TAIL +2 | $GREP gfarm2fs > /dev/null && \ (echo $DATE MOUNT:ALREADY $MOUNTP) || \ ($GFARMFS $ARCH $MOUNTP $ALLOWROOT && \ echo $DATE MOUNT:SUCCESS $MOUNTP || ! echo $DATE MOUNT:FAIL $MOUNTP) ) >> $LOGFILE 2>&1 exit $? |
gfarmfsumount.sh
#! /bin/sh FUSERMOUNT=/usr/local/bin/fusermount USERNAME=`/usr/bin/whoami` LOGFILE=/tmp/gfarm2fs-$USERNAME.log DATE=/bin/date SLEEP=/bin/sleep ##### if [ $# -ne 1 ]; then echo "usage: `basename $0` MOUNTPOINT" exit 1 fi if [ ! -f $LOGFILE ]; then touch $LOGFILE chmod 600 $LOGFILE fi DATE=`date '+%Y%m%d-%H%M%S'` MOUNTP=$1 (cd /; $SLEEP 1; $FUSERMOUNT -u $MOUNTP && \ echo $DATE UMOUNT:SUCCESS $MOUNTP || \ echo $DATE UMOUNT:FAIL $MOUNTP ) >> $LOGFILE 2>&1 & |