3 EXPORT_OPTS=${EXPORT_OPTS:-"rw,async,no_root_squash"}
8 local LUSTRE_CLIENT=${3}
10 local nfs_climntpt=${5:-$MNTPNT}
12 local export_opts_v=$EXPORT_OPTS
14 echo "Exporting Lustre filesystem..."
16 if [ "$NFS_VER" = "4" ]; then
17 export_opts_v="$EXPORT_OPTS,fsid=0"
18 do_nodes $LUSTRE_CLIENT "mkdir -p /var/lib/nfs/v4recovery"
21 do_nodes $LUSTRE_CLIENT,$NFS_CLIENTS "grep -q rpc_pipefs' ' /proc/mounts ||\
22 { mkdir -p /var/lib/nfs/rpc_pipefs && \
23 mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs; }" || return 1
26 # get rid of old $MNTPNT entries in /etc/exports
27 do_nodes $LUSTRE_CLIENT "sed -i '/${MNTPNT##*/}/d' /etc/exports &&
28 echo $MNTPNT *\($export_opts_v\) >> /etc/exports" ||
31 # restart nfs server according to distro
32 do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] &&
33 service nfsserver restart; } ||
34 service nfs restart ||
35 service nfs-server restart" || return 1
37 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
38 grep -q rpcidmapd && service rpcidmapd restart ||
41 echo -e "\nMounting NFS clients (version $NFS_VER)..."
43 do_nodes $NFS_CLIENTS "mkdir -p $nfs_climntpt" || return 1
44 if [ "$NFS_VER" = "4" ]; then
45 do_nodes $NFS_CLIENTS \
46 "mount -t nfs$NFS_VER -o async \
47 $LUSTRE_CLIENT:/ $nfs_climntpt" || return 1
49 do_nodes $NFS_CLIENTS \
50 "mount -t nfs -o nfsvers=$NFS_VER,async \
51 $LUSTRE_CLIENT:$MNTPNT $nfs_climntpt" || return 1
58 local LUSTRE_CLIENT=${2}
59 local NFS_CLIENTS=${3}
61 echo -e "\nUnmounting NFS clients..."
62 do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || true
64 echo -e "\nUnexporting Lustre filesystem..."
65 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
66 grep -q rpcidmapd && service rpcidmapd stop ||
69 do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] &&
70 service nfsserver stop; } ||
72 service nfs-server stop" || return 1
74 do_nodes $LUSTRE_CLIENT "sed -i '/${MNTPNT##*/}/d' /etc/exports" || return 1
76 do_nodes $LUSTRE_CLIENT "exportfs -v"