cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Fabio M. Di Nitto <fdinitto@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] rgmanager: add nfsdrestart option as last resource to umount fs
Date: Wed, 16 May 2012 15:36:54 +0200	[thread overview]
Message-ID: <1337175414-11599-1-git-send-email-fdinitto@redhat.com> (raw)

From: "Fabio M. Di Nitto" <fdinitto@redhat.com>

Resolves: rhbz#822053

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 rgmanager/src/resources/fs.sh.in |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/rgmanager/src/resources/fs.sh.in b/rgmanager/src/resources/fs.sh.in
index c43c177..404fe01 100644
--- a/rgmanager/src/resources/fs.sh.in
+++ b/rgmanager/src/resources/fs.sh.in
@@ -135,6 +135,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>
+
 	<parameter name="fsid">
 	    <longdesc lang="en">
 	    	File system ID for NFS exports.  This can be overridden
@@ -446,6 +458,20 @@ do_force_unmount() {
 		export nfslock_reclaim=1
 	fi
 
+	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
+
 	# Proceed with fuser -kvm...
 	return 1
 }
-- 
1.7.7.6



             reply	other threads:[~2012-05-16 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16 13:36 Fabio M. Di Nitto [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-05-16 13:37 [Cluster-devel] [PATCH] rgmanager: add nfsdrestart option as last resource to umount fs Fabio M. Di Nitto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337175414-11599-1-git-send-email-fdinitto@redhat.com \
    --to=fdinitto@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).