Skip to content

Commit

Permalink
rgmanager: add nfsdrestart option as last resource to umount clusterfs
Browse files Browse the repository at this point in the history
Resolves: rhbz#822053

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed May 21, 2012
1 parent bc1991f commit 05adf1b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions rgmanager/src/resources/clusterfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ do_metadata()
<content type="boolean"/>
</parameter>
<parameter name="nfsrestart" inherit="nfsrestart">
<longdesc lang="en">
If set and unmounting the file system fails, the node will
try to restart nfs daemon and nfs lockd to drop all filesystem
references. Use this option as last resource.
</longdesc>
<shortdesc lang="en">
Enable NFS daemon and lockd workaround
</shortdesc>
<content type="boolean"/>
</parameter>
</parameters>
<actions>
Expand Down Expand Up @@ -290,4 +302,21 @@ do_pre_unmount() {
return 0
}

do_force_unmount() {
if [ "$OCF_RESKEY_nfsrestart" = "yes" ] || \
[ "$OCF_RESKEY_nfsrestart" = "1" ]; then
if [ -f /proc/fs/nfsd/threads ]; then
ocf_log warning "Restarting nfsd/nfslock"
nfsdthreads="$(cat /proc/fs/nfsd/threads)"
service nfslock stop
rpc.nfsd 0
rpc.nfsd $nfsdthreads
service nfslock start
else
ocf_log err "Unable to determin nfsd information. nfsd restart aborted"
fi
fi
return 1
}

main $*

0 comments on commit 05adf1b

Please sign in to comment.