Skip to contentSkip to conversation

resource-agents: Try force-unmount before fuser for netfs.sh

PATCH New Lon Hohberger 2 participants 2 messages Mar 22, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 resource-agents: Try force-unmount before fuser for netfs.sh

RHEL5 only. A completely separate patch is needed for upstream and RHEL6

Resolves: rhbz#678494

---
 rgmanager/src/resources/netfs.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
rgmanager/src/resources/netfs.sh +6 -1
index 1a669d3..837a4c4 100755
@@ -486,6 +486,7 @@ stopNFSFilesystem() {
 	typeset no_umount=""
 	typeset force_umount=""
 	typeset fstype=""
+	typeset umount_flag=""
 
 
 	#
@@ -558,7 +559,7 @@ stopNFSFilesystem() {
 			sync; sync; sync
 			ocf_log info "unmounting $mp"
 
-                        umount $mp
+                        umount $umount_flag $mp
 			if  [ $? -eq 0 ]; then
                                 umount_failed=
                                 done=$YES
@@ -568,6 +569,10 @@ stopNFSFilesystem() {
 			umount_failed=yes
 
 			if [ "$force_umount" ]; then
+				if [ -z "$umount_flag" ]; then
+					umount_flag="-f"
+					continue
+				fi
 				if [ $try -eq 1 ]; then
 					fuser -TERM -kvm "$mp"
 				else
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 resource-agents: Try force-unmount before fuser for netfs.sh

ACK.

Fabio

Quoted 42 lines · Lon Hohberger

RHEL5 only. A completely separate patch is needed for upstream and RHEL6

Resolves: rhbz#678494

---
 rgmanager/src/resources/netfs.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
rgmanager/src/resources/netfs.sh +6 -1
index 1a669d3..837a4c4 100755
@@ -486,6 +486,7 @@ stopNFSFilesystem() {
 	typeset no_umount=""
 	typeset force_umount=""
 	typeset fstype=""
+	typeset umount_flag=""
 
 
 	#
@@ -558,7 +559,7 @@ stopNFSFilesystem() {
 			sync; sync; sync
 			ocf_log info "unmounting $mp"
 
-                        umount $mp
+                        umount $umount_flag $mp
 			if  [ $? -eq 0 ]; then
                                 umount_failed=
                                 done=$YES
@@ -568,6 +569,10 @@ stopNFSFilesystem() {
 			umount_failed=yes
 
 			if [ "$force_umount" ]; then
+				if [ -z "$umount_flag" ]; then
+					umount_flag="-f"
+					continue
+				fi
 				if [ $try -eq 1 ]; then
 					fuser -TERM -kvm "$mp"
 				else