I'll review the RA and include it in the repository.

I had a look, too as I would have needed something like this soon anyway.

My thoughts are attached in form of a patch file.

Regards
Dominik
exporting patch:
# HG changeset patch
# User Dominik Klein <[EMAIL PROTECTED]>
# Date 1214467018 -7200
# Node ID 412d1b01469463510ad3b61efb58f1dc4b77f257
# Parent  840f9d4fc05046bb6b5d14fc44264d31712a60d5
RA: Minor Route changes

diff -r 840f9d4fc050 -r 412d1b014694 resources/OCF/Route
--- a/resources/OCF/Route	Thu Jun 26 09:56:42 2008 +0200
+++ b/resources/OCF/Route	Thu Jun 26 09:56:58 2008 +0200
@@ -89,7 +89,7 @@ The source IP address to be configured f
 <action name="monitor"      timeout="20" interval="10" depth="0" start-delay="0"/>
 <action name="reload"       timeout="20" />
 <action name="meta-data"    timeout="5" />
-<action name="verify-all"   timeout="20" />
+<action name="validate-all"   timeout="20" />
 </actions>
 </resource-agent>
 END
@@ -135,7 +135,7 @@ route_start() {
 route_start() {
     route_status
     local status=$?
-    if [ $status =  $OCF_SUCCESS ]; then
+    if [ $status = $OCF_SUCCESS ]; then
 	ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : already started."
 	return $OCF_SUCCESS
     fi
@@ -193,21 +193,26 @@ route_validate() {
     if [ "${OCF_RESKEY_device}" ]; then
 	if ! ip link show ${OCF_RESKEY_device} >/dev/null 2>&1; then
 	    ocf_log error "Network device ${OCF_RESKEY_device} appears not to be available on this system."
-	    return $OCF_ERR_ARGS
+	    # OCF_ERR_ARGS prevents the resource from running _anywhere at all_
+	    # maybe another node has the interface?
+            # OCF_ERR_INSTALLED just prevents starting on the particular node
+	    return $OCF_ERR_INSTALLED
 	fi
     fi
     # If a source address has been configured, is it available on this system?
     if [ "${OCF_RESKEY_source}" ]; then
-	if ! ip address show | grep ${OCF_RESKEY_source} >/dev/null 2>&1; then
+	if ! ip address show | grep -w ${OCF_RESKEY_source} >/dev/null 2>&1; then
 	    ocf_log error "Source address ${OCF_RESKEY_source} appears not to be available on this system."
-	    return $OCF_ERR_ARGS
+	    # same reason as with _device:
+	    return $OCF_ERR_INSTALLED
 	fi
     fi
     # If a gateway address has been configured, is it reachable?
     if [ "${OCF_RESKEY_gateway}" ]; then
 	if ! ip route get ${OCF_RESKEY_gateway} >/dev/null 2>&1; then
 	    ocf_log error "Gateway address ${OCF_RESKEY_gateway} is unreachable."
-	    return $OCF_ERR_ARGS
+	    # same reason as with _device:
+	    return $OCF_ERR_INSTALLED
 	fi
     fi
     return $OCF_SUCCESS
@@ -215,7 +220,8 @@ route_validate() {
 
 case $__OCF_ACTION in
 meta-data)	meta_data
-		exit $OCF_SUCCESS
+		# OCF variables are not set when querying meta-data
+		exit 0
 		;;
 start)		route_validate && route_start;;
 stop)		route_stop;;
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to