This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RHEL4 - ip.sh: add sleeptime parameter


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c8858b18d8262a84615b38eb26fa8351269b01f3
Commit:        c8858b18d8262a84615b38eb26fa8351269b01f3
Parent:        b611004d87126adf8422c965dc8c54b26fcf0ff9
Author:        Ryan O'Hara <rohara@redhat.com>
AuthorDate:    Fri Aug 1 15:14:15 2008 -0500
Committer:     Ryan O'Hara <rohara@redhat.com>
CommitterDate: Fri Aug 1 16:56:04 2008 -0500

ip.sh: add sleeptime parameter

Allow user to specify amount of time to sleep after removing
and IP address ('stop' command). The sleeptime parameter is
specified in number of seconds. Default is 10 seconds.
Setting sleeptime to zero will result in no sleep.
---
 rgmanager/src/resources/ip.sh |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh
index b76bafc..307449b 100755
--- a/rgmanager/src/resources/ip.sh
+++ b/rgmanager/src/resources/ip.sh
@@ -110,6 +110,17 @@ meta_data()
 	    <content type="boolean"/>
 	</parameter>
 
+	<parameter name="sleeptime">
+	    <longdesc lang="en">
+		Amount of time to sleep after removing an IP address.
+		Value is specified in seconds. Default value is 10.
+	    </longdesc>
+	    <shortdesc lang="en">
+		Amount of time (seconds) to sleep.
+	    </shortdesc>
+	    <content type="string"/>
+	</parameter>
+
     </parameters>
 
     <actions>
@@ -911,7 +922,13 @@ stop)
 
 		# XXX Let nfsd/lockd clear their queues; we hope to have a
 		# way to enforce this in the future
-		sleep 10
+		if [ -z "$OCF_RESKEY_sleeptime" ]; then
+		    sleep 10
+		else
+		    if [ "$OCF_RESKEY_sleeptime" -gt "0" ]; then
+			sleep $OCF_RESKEY_sleeptime
+		    fi
+		fi
 	else
 		ocf_log debug "${OCF_RESKEY_address} is not configured"
 	fi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]