From b3cd04f1e4d377b089710163e8f574584f7aa2b2 Mon Sep 17 00:00:00 2001 From: Ricardo Martins Date: Mon, 16 Mar 2015 11:21:15 +0000 Subject: [PATCH] lctr-a6xx: added storage client script. --- .../lctr-a6xx/fs/etc/rc.d/lauv-storage-client | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 systems/lctr-a6xx/fs/etc/rc.d/lauv-storage-client diff --git a/systems/lctr-a6xx/fs/etc/rc.d/lauv-storage-client b/systems/lctr-a6xx/fs/etc/rc.d/lauv-storage-client new file mode 100644 index 0000000..a405a6f --- /dev/null +++ b/systems/lctr-a6xx/fs/etc/rc.d/lauv-storage-client @@ -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_server_paths; do + umount "$path" + done +}