--- resources/OCF/pgsql.in.distr	2006-09-29 14:49:05.000000000 -0400
+++ resources/OCF/pgsql.in	2006-09-29 14:57:04.000000000 -0400
@@ -28,7 +28,7 @@
 
 usage() {
     cat <<-! >&1
-	usage: $0 start|stop|status|monitor|methods
+	usage: $0 start|stop|status|monitor|meta-data|validate-all|methods
 
 	$0 manages a PostgreSQL Server as an HA resource.
 
@@ -36,6 +36,7 @@
         The 'stop' operation stops the PostgreSQL server.
         The 'status' operation reports whether the PostgreSQL is up.
         The 'monitor' operation reports whether the PostgreSQL is running.
+        The 'validate-all' operation reports whether the parameters are valid.
         The 'methods' operation reports on the methods $0 supports.
 !
   return $OCF_ERR_ARGS
@@ -111,6 +112,7 @@
 <action name="status" timeout="60" />
 <action name="monitor" depth="0" timeout="30" interval="30" start-delay="10" />
 <action name="meta-data" timeout="5" />
+<action name="validate-all" timeout="5" />
 <action name="methods" timeout="5" />
 </actions>
 </resource-agent>
@@ -136,6 +138,8 @@
 	status
 	monitor
 	methods	
+        meta-data
+        validate-all
 	!
 }
 
@@ -247,6 +251,24 @@
     return $OCF_SUCCESS
 }
 
+# Validate most critical parameters
+pgsql_validate_all() {
+    if [ ! -x $PGCTL ]
+    then
+        ocf_log err "Can't run $PGCTL"
+        return $OCF_ERR_CONFIGURED
+    fi
+
+    if [ ! -x $PSQL ]
+    then
+        ocf_log err "Can't run $PSQL"
+        return $OCF_ERR_CONFIGURED
+    fi
+
+    return $OCF_SUCCESS
+}
+
+
 #
 # Check if we need to create a log file
 #
@@ -301,18 +323,14 @@
 		
     meta-data)  meta_data
                 exit $OCF_SUCCESS;;
+
+    validate-all) pgsql_validate_all
+                exit $?;;
 esac
 
-if [ ! -x $PGCTL ]
-then
-    ocf_log err "Can't run $PGCTL"
-    exit $OCF_ERR_GENERIC
-fi
-    
-if [ ! -x $PSQL ]
+if ! pgsql_validate_all
 then
-    ocf_log err "Can't run $PSQL"
-    exit $OCF_ERR_GENERIC
+    exit $OCF_ERR_CONFIGURED
 fi
 
 # What kind of method was invoked?
