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 do_nodes $LUSTRE_CLIENT "echo $MNTPNT *\($export_opts_v\) \
27 >> /etc/exports" || return 1
29 # restart nfs server according to distro
30 do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] &&
31 service nfsserver restart; } ||
32 service nfs restart ||
33 service nfs-server restart" || return 1
35 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
36 grep -q rpcidmapd && service rpcidmapd restart ||
39 echo -e "\nMounting NFS clients (version $NFS_VER)..."
41 do_nodes $NFS_CLIENTS "mkdir -p $nfs_climntpt" || return 1
42 if [ "$NFS_VER" = "4" ]; then
43 do_nodes $NFS_CLIENTS \
44 "mount -t nfs$NFS_VER -o async \
45 $LUSTRE_CLIENT:/ $nfs_climntpt" || return 1
47 do_nodes $NFS_CLIENTS \
48 "mount -t nfs -o nfsvers=$NFS_VER,async \
49 $LUSTRE_CLIENT:$MNTPNT $nfs_climntpt" || return 1
56 local LUSTRE_CLIENT=${2}
57 local NFS_CLIENTS=${3}
59 echo -e "\nUnmounting NFS clients..."
60 do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || true
62 echo -e "\nUnexporting Lustre filesystem..."
63 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
64 grep -q rpcidmapd && service rpcidmapd stop ||
67 do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] &&
68 service nfsserver stop; } ||
70 service nfs-server stop" || return 1
72 do_nodes $LUSTRE_CLIENT "sed -i '/${MNTPNT##*/}/d' /etc/exports" || return 1
74 do_nodes $LUSTRE_CLIENT "exportfs -v"