- touch $DIR/$tfile || return 86
- stop_mds ${FORCE} || return 98
- cleanup
- eno=$?
- # ok for mds to fail shutdown
- if [ 201 -ne $eno ]; then
- return $eno;
- fi
+ touch $DIR/$tfile || return 1
+ stop_mds --force || return 2
+
+ # cleanup may return an error from the failed
+ # disconnects; for now I'll consider this successful
+ # if all the modules have unloaded.
+ umount $MOUNT &
+ UMOUNT_PID=$!
+ sleep $TIMEOUT
+ echo "killing umount"
+ kill -TERM $UMOUNT_PID
+ wait $UMOUNT_PID
+
+ # cleanup client modules
+ $LCONF --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null
+
+ # stop_mds is a no-op here, and should not fail
+ stop_mds || return 4
+ stop_ost || return 5
+
+ lsmod | grep -q portals && return 6