lctr-a6xx: brought lauv-storage-client from branch 1.9.x

This commit is contained in:
Ricardo Martins 2015-11-16 11:45:06 +00:00
parent ab6c5f7927
commit 329d92fbbc
1 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,45 @@
mount_path()
{
rpath="$cfg_lauv_storage_host:$1"
lpath="$1"
mkdir -p "$lpath"
mount -t nfs -o wsize=32768 "$rpath" "$lpath"
if [ $? -eq 0 ]; then
echo "* Mounted '$rpath' in '$lpath'"
return 0
fi
return 1
}
start()
{
/usr/bin/rpcbind
if [ $? -ne 0 ]; then
echo "ERROR: failed to start rpcbind."
return 1
fi
for path in $cfg_lauv_storage_paths; do
n=0; while [ $n -lt "$cfg_lauv_storage_timeout" ]; do
mount_path "$path"
if [ $? -eq 0 ]; then
break
fi
let n++
sleep 1
done
done
}
stop()
{
killall rpcbind
for path in $cfg_lauv_storage_paths; do
umount "$path"
done
}