cluster: STABLE31 - Drop resource-agents

Fabio M. Di Nitto fabbione at fedoraproject.org
Wed Oct 6 18:30:37 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=24d3d1f98e6c2681d3f74b9e25ed8596d31d9f16
Commit:        24d3d1f98e6c2681d3f74b9e25ed8596d31d9f16
Parent:        803f7abd0eafacb4c888e821f1b70ed5a4ec2a46
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Wed Oct 6 20:30:04 2010 +0200
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Wed Oct 6 20:30:04 2010 +0200

Drop resource-agents

See https://www.redhat.com/archives/linux-cluster/2010-October/msg00012.html

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 configure                                          |    7 -
 make/defines.mk.input                              |    1 -
 rgmanager/src/Makefile                             |    4 -
 rgmanager/src/resources/ASEHAagent.sh              |  900 -----------------
 rgmanager/src/resources/Makefile                   |  109 --
 rgmanager/src/resources/SAPDatabase                | 1025 -------------------
 rgmanager/src/resources/SAPInstance                |  591 -----------
 rgmanager/src/resources/apache.metadata            |   95 --
 rgmanager/src/resources/apache.sh                  |  255 -----
 rgmanager/src/resources/clusterfs.sh               |  275 -----
 rgmanager/src/resources/default_event_script.sl    |  617 -----------
 rgmanager/src/resources/drbd.metadata              |   51 -
 rgmanager/src/resources/drbd.sh                    |  144 ---
 rgmanager/src/resources/follow-service.sl          |  151 ---
 rgmanager/src/resources/fs.sh.in                   |  443 --------
 rgmanager/src/resources/ip.sh                      |  970 ------------------
 rgmanager/src/resources/lvm.metadata               |   86 --
 rgmanager/src/resources/lvm.sh                     |  134 ---
 rgmanager/src/resources/lvm_by_lv.sh               |  415 --------
 rgmanager/src/resources/lvm_by_vg.sh               |  401 --------
 rgmanager/src/resources/mysql.metadata             |  106 --
 rgmanager/src/resources/mysql.sh                   |  174 ----
 rgmanager/src/resources/named.metadata             |  104 --
 rgmanager/src/resources/named.sh                   |  193 ----
 rgmanager/src/resources/netfs.sh                   |  376 -------
 rgmanager/src/resources/nfsclient.sh               |  445 --------
 rgmanager/src/resources/nfsexport.sh               |  238 -----
 rgmanager/src/resources/nfsserver.sh               |  489 ---------
 rgmanager/src/resources/ocf-shellfuncs             |  165 ---
 rgmanager/src/resources/openldap.metadata          |   98 --
 rgmanager/src/resources/openldap.sh                |  209 ----
 rgmanager/src/resources/oracledb.sh.in             |  886 ----------------
 rgmanager/src/resources/postgres-8.metadata        |   95 --
 rgmanager/src/resources/postgres-8.sh              |  206 ----
 rgmanager/src/resources/ra-api-1-modified.dtd      |   68 --
 rgmanager/src/resources/ra2man.xsl                 |  158 ---
 rgmanager/src/resources/ra2ref.xsl                 |   10 -
 rgmanager/src/resources/ra2rng.xsl                 |   54 -
 rgmanager/src/resources/resources.rng.head         |    1 -
 rgmanager/src/resources/resources.rng.mid          |    3 -
 rgmanager/src/resources/resources.rng.tail         |   24 -
 rgmanager/src/resources/samba.metadata             |   89 --
 rgmanager/src/resources/samba.sh                   |  223 ----
 rgmanager/src/resources/script.sh                  |  103 --
 rgmanager/src/resources/service.sh                 |  282 ------
 rgmanager/src/resources/smb.sh                     |  677 -------------
 rgmanager/src/resources/svclib_nfslock             |  262 -----
 rgmanager/src/resources/tomcat-5.metadata          |  104 --
 rgmanager/src/resources/tomcat-5.sh                |  256 -----
 rgmanager/src/resources/tomcat-6.metadata          |   74 --
 rgmanager/src/resources/tomcat-6.sh                |  222 ----
 rgmanager/src/resources/utils/config-utils.sh.in   |  242 -----
 rgmanager/src/resources/utils/fs-lib.sh            |  946 -----------------
 .../src/resources/utils/httpd-parse-config.pl      |   65 --
 rgmanager/src/resources/utils/member_util.sh       |   66 --
 rgmanager/src/resources/utils/messages.sh          |  251 -----
 .../src/resources/utils/named-parse-config.pl      |   26 -
 rgmanager/src/resources/utils/ra-skelet.sh         |  109 --
 .../src/resources/utils/tomcat-parse-config.pl     |   45 -
 rgmanager/src/resources/vm.sh                      | 1066 --------------------
 60 files changed, 0 insertions(+), 15884 deletions(-)

diff --git a/configure b/configure
index 735f248..d6d5295 100755
--- a/configure
+++ b/configure
@@ -94,7 +94,6 @@ my %options = (
 	without_fence => \$without_fence,
 	without_fence_agents => \$without_fence_agents,
 	without_rgmanager => \$without_rgmanager,
-	without_resource_agents => \$without_resource_agents,
 	without_bindings => \$without_bindings,
 	disable_kernel_check => \$disable_kernel_check,
 );
@@ -174,7 +173,6 @@ my $err = &GetOptions (\%options,
 		    'without_fence',
 		    'without_fence_agents',
 		    'without_rgmanager',
-		    'without_resource_agents',
 		    'without_bindings',
 		    'disable_kernel_check');
 
@@ -262,7 +260,6 @@ if ($help || !$err) {
   print "--without_fence\tDisable fence building  (Default: enabled)\n";
   print "--without_fence_agents\tDisable fence_agents building  (Default: enabled)\n";
   print "--without_rgmanager\tDisable rgmanager building  (Default: enabled)\n";
-  print "--without_resource_agents\tDisable resource agents building  (Default: enabled)\n";
   print "--without_bindings\tDisable perl/python bindings building  (Default: enabled)\n";
   print "--disable_kernel_check\tDisable kernel version check  (Default: enabled)\n";
   exit $ret;
@@ -597,9 +594,6 @@ if (!$without_fence_agents) {
 if (!$without_rgmanager) {
   $without_rgmanager="";
 }
-if (!$without_resource_agents) {
-  $without_resource_agents="";
-}
 if (!$without_bindings) {
   $without_bindings="";
 }
@@ -717,7 +711,6 @@ while (<IFILE>) {
   $_ =~ s/\@DISABLE_GROUP\@/$without_group/;
   $_ =~ s/\@DISABLE_FENCE\@/$without_fence/;
   $_ =~ s/\@DISABLE_RGMANAGER\@/$without_rgmanager/;
-  $_ =~ s/\@DISABLE_RESOURCE_AGENTS\@/$without_resource_agents/;
   $_ =~ s/\@DISABLE_BINDINGS\@/$without_bindings/;
 
   print OFILE "$_\n";
diff --git a/make/defines.mk.input b/make/defines.mk.input
index a63ae25..456a7d1 100644
--- a/make/defines.mk.input
+++ b/make/defines.mk.input
@@ -75,7 +75,6 @@ without_dlm ?= @DISABLE_DLM@
 without_group ?= @DISABLE_GROUP@
 without_fence ?= @DISABLE_FENCE@
 without_rgmanager ?= @DISABLE_RGMANAGER@
-without_resource_agents ?= @DISABLE_RESOURCE_AGENTS@
 without_bindings ?= @DISABLE_BINDINGS@
 
 THISDIR = $(shell echo $(CURDIR) | sed -e 's|$(OBJDIR)/||g')
diff --git a/rgmanager/src/Makefile b/rgmanager/src/Makefile
index e6bd048..f5b9d03 100644
--- a/rgmanager/src/Makefile
+++ b/rgmanager/src/Makefile
@@ -2,7 +2,3 @@ include ../../make/defines.mk
 include $(OBJDIR)/make/passthrough.mk
 
 SUBDIRS= clulib daemons utils
-
-ifndef without_resource_agents
-SUBDIRS += resources
-endif
diff --git a/rgmanager/src/resources/ASEHAagent.sh b/rgmanager/src/resources/ASEHAagent.sh
deleted file mode 100644
index 4c906a9..0000000
--- a/rgmanager/src/resources/ASEHAagent.sh
+++ /dev/null
@@ -1,900 +0,0 @@
-#!/bin/bash
-
-# 
-# Sybase Availability Agent for Red Hat Cluster v15.0.2 
-# Copyright (C) - 2007
-# Sybase, Inc. All rights reserved.
-#
-# Sybase Availability Agent for Red Hat Cluster v15.0.2 is licensed
-# under the GNU General Public License Version 2.
-#
-# Author(s):
-#    Jian-ping Hui <jphui at sybase.com>
-#
-# Description: Service script for starting/stopping/monitoring \
-#              Sybase Adaptive Server on: \
-#                            Red Hat Enterprise Linux 5 ES \
-#                            Red Hat Enterprise Linux 5 AS
-#
-# NOTES:
-#
-# (1) Before running this script, we assume that user has installed
-#     Sybase ASE 15.0.2 or higher version on the machine. Please
-#     customize your configuration in /etc/cluster/cluster.conf according
-#     to your actual environment. We assume the following files exist before
-#     you start the service:
-#         /$sybase_home/SYBASE.sh
-#         /$sybase_home/$sybase_ase/install/RUN_$server_name
-#
-# (2) You can customize the interval value in the meta-data section if needed:
-#                <action name="start" timeout="300" />
-#                <action name="stop" timeout="300" />
-#                
-#                <!-- Checks to see if it''s mounted in the right place -->
-#                <action name="status"  interval="30" timeout="100" />
-#                <action name="monitor" interval="30" timeout="100" />
-#                
-#                <!--Checks to see if we can read from the mountpoint -->
-#                <action name="status" depth="10" timeout="100" interval="120" />
-#                <action name="monitor" depth="10" timeout="100" interval="120" />
-#                
-#                <action name="meta-data" timeout="5" />
-#                <action name="validate-all" timeout="5" />
-#     The timeout value is not supported by Redhat in RHCS5.0. 
-# 
-# (3) This script should be put under /usr/share/cluster. Its owner should be "root" with 
-#     execution permission.
-#
-
-. /etc/init.d/functions
-. $(dirname $0)/ocf-shellfuncs
-
-PROG=${0}
-
-export LD_POINTER_GUARD=0
-
-#######################################################################################
-# Declare some variables we will use in the script. Please don't change their values. #
-#######################################################################################
-declare login_string=""
-declare RUNSERVER_SCRIPT=$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase/install/RUN_$OCF_RESKEY_server_name
-declare CONSOLE_LOG=$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase/install/$OCF_RESKEY_server_name.log
-
-##################################################################################################
-# This function will be called by rgmanager to get the meta data of resource agent "ASEHAagent". #
-# NEVER CHANGE ANYTHING IN THIS FUNCTION.
-##################################################################################################
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="ASEHAagent" version="rgmanager 2.0">
-	<version>1.0</version>
-
-	<longdesc lang="en">
-		Sybase ASE Failover Instance
-	</longdesc>
-	<shortdesc lang="en">
-		Sybase ASE Failover Instance
-	</shortdesc>
-
-	<parameters>
-		<parameter name="name" unique="1" primary="1">
-			<longdesc lang="en">
-				Instance name of resource agent "ASEHAagent"
-			</longdesc>
-			<shortdesc lang="en">
-				name
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="sybase_home" unique="1" required="1">
-			<longdesc lang="en">
-				The home directory of sybase products
-			</longdesc>
-			<shortdesc lang="en">
-				SYBASE home directory
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="sybase_ase" unique="1" required="1">
-			<longdesc lang="en">
-				The directory name under sybase_home where ASE products are installed
-			</longdesc>
-			<shortdesc lang="en">
-				SYBASE_ASE directory name
-			</shortdesc>
-			<content type="string" default="ASE-15_0" />
-		</parameter>
-
-		<parameter name="sybase_ocs" unique="1" required="1">
-			<longdesc lang="en">
-				The directory name under sybase_home where OCS products are installed, i.e. ASE-15_0
-			</longdesc>
-			<shortdesc lang="en">
-				SYBASE_OCS directory name
-			</shortdesc>
-			<content type="string" default="OCS-15_0" />
-		</parameter>
-
-		<parameter name="server_name" unique="1" required="1">
-			<longdesc lang="en">
-				The ASE server name which is configured for the HA service
-			</longdesc>
-			<shortdesc lang="en">
-				ASE server name
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="login_file" unique="1" required="1">
-			<longdesc lang="en">
-				The full path of login file which contains the login/password pair
-			</longdesc>
-			<shortdesc lang="en">
-				Login file
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="interfaces_file" unique="1" required="1">
-			<longdesc lang="en">
-				The full path of interfaces file which is used to start/access the ASE server
-			</longdesc>
-			<shortdesc lang="en">
-				Interfaces file
-			</shortdesc>
-			<content type="string" />
-		</parameter>
-
-		<parameter name="sybase_user" unique="1" required="1">
-			<longdesc lang="en">
-				The user who can run ASE server
-			</longdesc>
-			<shortdesc lang="en">
-				Sybase user
-			</shortdesc>
-			<content type="string" default="sybase" />
-		</parameter>
-
-		<parameter name="shutdown_timeout" unique="1" required="1">
-			<longdesc lang="en">
-				The maximum seconds to wait for the ASE server to shutdown before killing the process directly
-			</longdesc>
-			<shortdesc>
-				Shutdown timeout value
-			</shortdesc>
-			<content type="integer" default="0" />
-		</parameter>
-
-		<parameter name="start_timeout" unique="1" required="1">
-			<longdesc lang="en">
-				The maximum seconds to wait for an ASE server to complete before determining that the server had failed to start
-			</longdesc>
-			<shortdesc lang="en">
-				Start timeout value
-			</shortdesc>
-			<content type="integer" default="0" />
-		</parameter>
-
-		<parameter name="deep_probe_timeout" unique="1" required="1">
-			<longdesc lang="en">
-				The maximum seconds to wait for the response of ASE server before determining that the server had no response while running deep probe
-			</longdesc>
-			<shortdesc lang="en">
-				Deep probe timeout value
-			</shortdesc>
-			<content type="integer" default="0" />
-		</parameter>
-	</parameters>
-	<actions>
-		<action name="start" timeout="300" />
-		<action name="stop" timeout="300" />
-		
-		<!-- Checks to see if it''s mounted in the right place -->
-		<action name="status"  interval="30" timeout="100" />
-		<action name="monitor" interval="30" timeout="100" />
-		
-		<!--Checks to see if we can read from the mountpoint -->
-		<action name="status" depth="10" timeout="100" interval="120" />
-		<action name="monitor" depth="10" timeout="100" interval="120" />
-		
-		<action name="meta-data" timeout="5" />
-		<action name="validate-all" timeout="5" />
-	</actions>
-
-	<special tag="rgmanager">
-	</special>
-</resource-agent>
-EOT
-}
-
-##################################################################################################
-# Function Name: validate_all                                                                    #
-# Parameter: None                                                                                #
-# Return value:                                                                                  #
-#             0               SUCCESS                                                            #
-#             OCF_ERR_ARGS    Parameters are invalid                                             #
-# Description: Do some validation on the user-configurable stuff at the beginning of the script. #
-##################################################################################################
-verify_all() 
-{
-	ocf_log debug "ASEHAagent: Start 'verify_all'"
-
-	# Check if the parameter 'sybase_home' is set.	
-	if [[ -z "$OCF_RESKEY_sybase_home" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'sybase_home' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'sybase_home' is a valid path.
-	if [[ ! -d $OCF_RESKEY_sybase_home ]]
-	then
-		ocf_log err "ASEHAagent: The sybase_home '$OCF_RESKEY_sybase_home' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the script file SYBASE.sh exists
-	if [[ ! -f $OCF_RESKEY_sybase_home/SYBASE.sh ]]
-	then
-		ocf_log err "ASEHAagent: The file $OCF_RESKEY_sybase_home/SYBASE.sh is required to run this script. Failed to run the script."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'sybase_ase' is set.
-	if [[ -z "$OCF_RESKEY_sybase_ase" ]] 
-	then
-		ocf_log err "ASEHAagent: The parameter 'sybase_ase' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the directory /$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase exists.
-	if [[ ! -d $OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase ]]
-	then
-		ocf_log err "ASEHAagent: The directory '$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'sybase_ocs' is set.
-	if [[ -z "$OCF_RESKEY_sybase_ocs" ]] 
-	then
-		ocf_log err "ASEHAagent: The parameter 'sybase_ocs' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the directory /$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ocs exists.
-	if [[ ! -d $OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ocs ]]
-	then
-		ocf_log err "ASEHAagent: The directory '$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ocs' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'server_name' is set.	
-	if [[ -z "$OCF_RESKEY_server_name" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'server_name' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the Run_server file exists.
-	if [[ ! -f $RUNSERVER_SCRIPT ]]
-	then
-		ocf_log err "ASEHAagent: There file $RUNSERVER_SCRIPT doesn't exist. The sybase directory may be incorrect."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'login_file' is set.	
-	if [[ -z "$OCF_RESKEY_login_file" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'login_file' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the login file exist.
-	if [[ ! -f $OCF_RESKEY_login_file ]]
-	then
-		ocf_log err "ASEHAagent: The login file '$OCF_RESKEY_login_file' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'sybase_user' is set
-	if [[ -z "$OCF_RESKEY_sybase_user" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'sybase_user' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the user 'sybase_user' exist
-	id -u $OCF_RESKEY_sybase_user
-	if [[ $? != 0 ]]
-	then
-		ocf_log err "ASEHAagent: The user '$OCF_RESKEY_sybase_user' doesn't exist in the system."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'interfaces_file' is set
-	if [[ -z "$OCF_RESKEY_interfaces_file" ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'interfaces_file' is not set."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the file 'interfaces_file' exists
-	if [[ ! -f $OCF_RESKEY_interfaces_file ]]
-	then
-		ocf_log err "ASEHAagent: The interfaces file '$OCF_RESKEY_interfaces_file' doesn't exist."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'shutdown_timeout' is a valid value
-	if [[ $OCF_RESKEY_shutdown_timeout -eq 0 ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'shutdown_timeout' is not set. Its value cannot be zero."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'start_timeout' is a valid value
-	if [[ $OCF_RESKEY_start_timeout -eq 0 ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'start_timeout' is not set. Its value cannot be zero."
-		return $OCF_ERR_ARGS
-	fi
-
-	# Check if the parameter 'deep_probe_timeout' is a valid value
-	if [[ $OCF_RESKEY_deep_probe_timeout -eq 0 ]]
-	then
-		ocf_log err "ASEHAagent: The parameter 'deep_probe_timeout' is not set. Its value cannot be zero."
-		return $OCF_ERR_ARGS
-	fi
-
-	ocf_log debug "ASEHAagent: End 'verify_all' successfully."
-
-	return 0
-}
-
-################################################################################################################
-# Function name: get_login_string                                                                              #
-# Parameter: None                                                                                              #
-# Return value:                                                                                                #
-#              0    SUCCESS                                                                                    #
-#              1    FAIL                                                                                       #
-# Description: Analyze the login_file to format the login string. This function will set the global variable   #
-#              "login_string". If the login/password is clear text, the "login_string" will become to "-Ulogin #
-#              -Ppassword" if there is no error. If there are any errors in this function, the string          #
-#              "login_string" will be still empty. In current stage, the encrypted string is not supported     #
-#              because "haisql" is not available on this platform.                                             #
-################################################################################################################
-get_login_string()
-{
-	tmpstring=""
-	login_sting=""
-
-	# Read the first column. The valid value will be "normal" or "encrypted". Any other values are invalid.
-	login_type=`head -1 $OCF_RESKEY_login_file | awk '{print $1}'`
-	if [[ $login_type = "normal" ]]
-	then
-		# The login/password pair is saved in clear text.
-		# Abstract the login/password from the line. 
-		tmpstring=`head -1 $OCF_RESKEY_login_file | awk '{print $2}'`
-
-		# Abstract "user" from the string.
-		user=`echo $tmpstring | awk -F'/' '{print $1}'`
-		# Check if the "user" string is NULL. If it is NULL, it means this is not a valid user.
-		if  [[ -z $user ]]
-		then
-			ocf_log err "ASEHAagent: Login username is not specified in the file '$OCF_RESKEY_login_file'"
-			return 1
-		fi
-
-		# Abstract "password" from the string.
-		passwd=`echo $tmpstring | awk -F'/' '{print $2}'`
-
-		# Format the "login_string".
-		login_string="-U$user -P$passwd"
-	else
-		# The login_type is invalid value.
-		ocf_log err "ASEHAagent: Login type specified in the file $OCF_RESKEY_login_file is not 'normal' or 'encrypted' which are only supported values."
-		return 1
-	fi
-
-	# The "login_file" has been analyzed successfully. Now, the value of "login_string" contains the login/password information.
-	return 0
-}
-
-##############################################################################################
-# Function name: ase_start                                                                   #
-# Parameter: None                                                                            #
-# Return value:                                                                              #
-#             0  SUCCESS                                                                     #
-#             1  FAIL                                                                        #
-# Description: This function is used to start the ASE server in primary or secondary server. #
-##############################################################################################
-ase_start()
-{
-	ocf_log debug "ASEHAagent: Start 'ase_start'"
-
-	# Check if the server is running. If yes, return SUCCESS directly. Otherwise, continue the start work.
-	ase_is_running
-	if [[ $? = 0 ]]
-	then
-		# The server is running. 
-		ocf_log info "ASEHAagent: Server is running. Start is success."
-		return 0
-	fi
-
-	# The server is not running. We need to start it.
-	# If the log file existed, delete it.
-	if [[ -f $CONSOLE_LOG ]]
-	then
-		rm -f $CONSOLE_LOG
-	fi
-		
-	ocf_log debug "ASEHAagent: Starting '$OCF_RESKEY_server_name'..."
-
-	# Run runserver script to start the server. Since this script will be run by root and ASE server
-	# needs to be run by another user, we need to change the user to sybase_user first. Then, run
-	# the script to start the server.
-	su $OCF_RESKEY_sybase_user -c ksh << EOF
-		# set required SYBASE environment by running SYBASE.sh.
-		. $OCF_RESKEY_sybase_home/SYBASE.sh
-		# Run the RUNSERVER_SCRIPT to start the server.
-                . $RUNSERVER_SCRIPT > $CONSOLE_LOG 2>&1 &
-EOF
-
-	# Monitor every 1 seconds if the server has
-	# recovered, until RECOVERY_TIMEOUT.
-	t=0
-	while [[ $t -le $OCF_RESKEY_start_timeout ]]
-	do
-		grep -s "Recovery complete." $CONSOLE_LOG > /dev/null 2>&1
-		if [[ $? != 0 ]]
-		then
-			# The server has not completed the recovery. We need to continue to monitor the recovery
-			# process.
-			t=`expr $t + 1`
-		else
-			# The server has completed the recovery.
-			ocf_log info "ASEHAagent: ASE server '$OCF_RESKEY_server_name' started successfully."
-			break
-		fi
-		sleep 1
-	done
-
-	# If $t is larger than start_timeout, it means the ASE server cannot start in given time. Otherwise, it 
-	# means the ASE server has started successfully.
-	if [[ $t -gt $OCF_RESKEY_start_timeout ]]
-	then
-		# The server cannot start in specified time. We think the start is failed.
-		ocf_log err "ASEHAagent: Failed to start ASE server '$OCF_RESKEY_server_name'. Please check the server error log $CONSOLE_LOG for possible problems."
-		return 1
-	fi
-
-	ocf_log debug "ASEHAagent: End 'ase_start' successfully."
-
-	return 0
-}
-
-#############################################################################################
-# Function name: ase_stop                                                                   #
-# Parameter: None                                                                           #
-# Return value:                                                                             #
-#             0  SUCCESS                                                                    #
-#             1  FAIL                                                                       #
-# Description: This function is used to stop the ASE server in primary or secondary server. #
-#############################################################################################
-ase_stop()
-{
-	ocf_log debug "ASEHAagent: Start 'ase_stop'"
-
-	# Check if the ASE server is still running.
-	ase_is_running
-	if [[ $? != 0 ]]
-	then
-		# The ASE server is not running. We need not to shutdown it.
-		ocf_log info "ASEHAagent: The dataserver $OCF_RESKEY_server_name is not running."
-		return 0
-	fi
-
-	# Call get_login_string() to parse the login/password string
-	get_login_string
-	if [[ $? = 1 ]]
-	then
-		# The login account cannot be used. So we will kill the process directly.
-		ocf_log info "ASEHAagent: Cannot parse the login file $OCF_RESKEY_login_file. Kill the processes of ASE directly."
-		# Kill the OS processes immediately.
-		kill_ase 0
-		return $?
-	fi
-
-	# Just in case things are hung, start a process that will wait for the
-	# timeout period, then kill any remaining porcesses.  We'll need to
-	# monitor this process (set -m), so we can terminate it later if it is
-	# not needed.
-	set -m
-	$PROG kill &
-	KILL_PID=$!     # If successful, we will also terminate watchdog process
-
-	# Run "shutdown with nowait" from isql command line to shutdown the server
-	su $OCF_RESKEY_sybase_user -c ksh << EOF
-		# set required SYBASE environment by running SYBASE.sh.
-		. $OCF_RESKEY_sybase_home/SYBASE.sh
-		# Run "shutdown with nowait" to shutdown the server immediately.
-		(echo "use master" ; echo go ; echo "shutdown with nowait"; echo go) | \
-		\$SYBASE/\$SYBASE_OCS/bin/isql $login_string -S$OCF_RESKEY_server_name -I$OCF_RESKEY_interfaces_file  &
-EOF
-
-	sleep 5
-
-	# Check if the server has been shutted down successfully
-	t=0
-	while [[ $t -lt $OCF_RESKEY_shutdown_timeout ]]
-	do
-		# Search "usshutdown: exiting" in the server log. If found, it means the server has been shutted down. 
-		# Otherwise, we need to wait.
-		tail $CONSOLE_LOG | grep "ueshutdown: exiting" > /dev/null 2>&1
-		if [[ $? != 0 ]]
-		then
-			# The shutdown is still in processing. Wait...
-			sleep 2
-			t=`expr $t+2`
-		else
-			# The shutdown is success.
-			ocf_log info "ASEHAagent: ASE server '$OCF_RESKEY_server_name' shutdown with isql successfully."
-			break
-		fi
-	done
-
-	# If $t is larger than shutdown_timeout, it means the ASE server cannot be shutted down in given time. We need
-	# to wait for the background kill process to kill the OS processes directly.
-	if  [[ $t -ge $OCF_RESKEY_shutdown_timeout ]]
-	then
-		ocf_log err "ASEHAagent: Shutdown of '$OCF_RESKEY_server_name' from isql failed.  Server is either down or unreachable."
-	fi
-
-	# Here, the ASE server has been shutted down by isql command or killed by background process. We need to do
-	# further check to make sure all processes have gone away before saying shutdown is complete. This stops the
-	# other node from starting up the package before it has been stopped and the file system has been unmounted.
-	
-	# Get all processes ids from log file
-	declare -a ENGINE_ALL=(`sed -n -e '/engine /s/^.*os pid \([0-9]*\).*online$/\1/p' $CONSOLE_LOG`)
-	typeset -i num_procs=${#ENGINE_ALL[@]}
-
-	# We cannot find any process id from log file. It may be because the log file is corrupted or be deleted.
-	# In this case, we determine the shutdown is failed.
-	if [[ "${ENGINE_ALL[@]}" = "" ]]
-	then
-		ocf_log err "ASEHAagent: Unable to find the process id from $CONSOLE_LOG."
-		ocf_log err "ASEHAagent: Stop ASE server failed."
-		return 1
-	fi
-
-	# Monitor the system processes to make sure all ASE related processes have gone away.
-	while true
-	do
-		# To every engine process, search it in system processes list. If it is not in the
-		# list, it means this process has gone away. Otherwise, we need to wait for it is
-		# killed by background process.
-		for i in ${ENGINE_ALL[@]}
-		do
-			ps -fu $OCF_RESKEY_sybase_user | awk '{print $2}' | grep $i | grep -v grep
-			if [[ $? != 0 ]]
-			then
-				ocf_log debug "ASEHAagent: $i process has stopped."
-				c=0
-				while (( c < $num_procs ))
-				do
-					if [[ ${ENGINE_ALL[$c]} = $i ]]
-					then
-						unset ENGINE_ALL[$c]
-						c=$num_procs
-					fi
-					(( c = c + 1 ))	
-				done
-			fi
-		done
-		
-		# To here, all processes should have gone away. 
-		if [[ ${ENGINE_ALL[@]} = "" ]]
-		then
-			#
-			# Looks like shutdown was successful, so kill the
-			# script to kill any hung processes, which we started earlier.
-			# Check to see if the script is still running.  If jobs
-			# returns that the script is done, then we don't need to kill
-			# it.
-			#
-			job=$(jobs | grep -v Done)
-			if [[ ${job} != "" ]]
-			then
-				ocf_log debug "ASEHAagent: Killing the kill_ase script."
-
-				kill -15 $KILL_PID > /dev/null 2>&1
-			fi
-			break
-	        fi
-		sleep 5
-	done
-
-	ocf_log debug "ASEHAagent: End 'ase_stop'."
-
-	return 0
-}
-
-####################################################################################
-# Function name: ase_is_running                                                    #
-# Parameter: None                                                                  #
-# Return value:                                                                    #
-#             0   ASE server is running                                            #
-#             1   ASE server is not running or there are errors                    #
-# Description: This function is used to check if the ASE server is still running . #
-####################################################################################
-ase_is_running()
-{
-	# If the error log doesn't exist, we can say there is no ASE is running.
-	if [[ ! -f $CONSOLE_LOG ]]
-	then
-		return 1
-	fi
-
-	# The error log file exists. Check if the engine 0 is alive.
-	ENGINE_0=(`sed -n -e '/engine 0/s/^.*os pid \([0-9]*\).*online$/\1/p' $CONSOLE_LOG`)
-	if [[ "$ENGINE_0" = "" ]]
-	then
-		# The engine 0 is down.
-		return 1 
-	else
-		kill -s 0 $ENGINE_0 > /dev/null 2>&1
-		if [[ $? != 0 ]]
-		then
-			# The engine 0 is not running.
-			return 1
-		else
-			# The engine 0 is running.
-			return 0
-		fi
-        fi
-
-	return 1
-}
-
-####################################################################################
-# Function name: ase_is_running                                                    #
-# Parameter:                                                                       #
-#             DELAY  The seconds to wait before killing the ASE processes. 0 means #
-#                    kill the ASE processes immediately.                           #
-# Return value: None                                                               #
-#             1   ASE server is not running or there are errors                    #
-# Description: This function is used to check if the ASE server is still running . #
-####################################################################################
-kill_ase()
-{
-	ocf_log debug "ASEHAagent: Start 'kill_ase'."
-
-	DELAY=$1
-
-	# Wait for sometime before sending a kill signal.  
-	t=0
-        while [[ $t -lt $DELAY ]]
-        do
-     		sleep 1
-		t=`expr $t+1`
-        done
-
-	# Get the process ids from log file
-	declare -a ENGINE_ALL=`sed -n -e '/engine /s/^.*os pid \([0-9]*\).*online$/\1/p' $CONSOLE_LOG`
-
-	# If there is no process id found in the log file, we need not to continue.
-	if [[ "${ENGINE_ALL[@]}" = "" ]]
-	then
-		ocf_log err "ASEHAagent: Unable to find the process id from $CONSOLE_LOG."
-		return
-	fi
-
-	# Kill the datasever process(es)
-	for pid in ${ENGINE_ALL[@]}
-	do
-		kill -9 $pid > /dev/null 2>&1
-		if [[ $? != 0 ]]
-		then
-			ocf_log info "ASEHAagent: kill_ase function did NOT find process $pid running."
-		else
-			ocf_log info "ASEHAagent: kill_ase function did find process $pid running.  Sent SIGTERM."
-		fi
-	done
-
-	ocf_log debug "ASEHAagent: End 'kill_ase'."
-}
-
-
-#######################################################################################
-# Function name: terminate                                                            #
-# Parameter: None                                                                     #
-# Return value: Always be 1                                                           #
-# Description: This function is called automatically after this script is terminated. #
-#######################################################################################
-terminate()
-{
-	ocf_log debug "ASEHAagent: This monitor script has been signaled to terminate."
-	exit 1
-}
-
-#####################################################################################
-# Function name: ase_status                                                         #
-# Parameter:                                                                        #
-#             0   Level 0 probe. In this level, we just check if engine 0 is alive  #
-#             10  Level 10 probe. In this level, we need to probe if the ASE server #
-#                 still has response.                                               #              
-# Return value:                                                                     #
-#             0   The server is still alive                                         #
-#             1   The server is down                                                #
-# Description: This function is used to check if the ASE server is still running.   #
-#####################################################################################
-ase_status()
-{
-	ocf_log debug "ASEHAagent: Start 'ase_status'."
-
-	# Step 1: Check if the engine 0 is alive
-	ase_is_running
-	if [[ $? = 1 ]]
-	then
-		# ASE is down. Return fail to rgmanager to trigger the failover process.
-		ocf_log err "ASEHAagent: ASE server is down."
-		return 1
-	fi
-
-	# ASE process is still alive. 
-	# Step2: If this is level 10 probe, We need to check if the ASE server still has response.
-	if [[ $1 -gt 0 ]]
-	then
-		ocf_log debug "ASEHAagent: Need to run deep probe."
-		# Run deep probe
-		deep_probe
-		if [[ $? = 1 ]]
-		then
-			# Deep probe failed. This means the server has been down.
-			ocf_log err "ASEHAagent: Deep probe found the ASE server is down."
-			return 1
-		fi
-	fi
-
-	ocf_log debug "ASEHAagent: End 'ase_status'."
-
-	return 0
-}
-
-####################################################################################
-# Function name: deep_probe                                                        #
-# Parameter: None                                                                  #
-# Return value:                                                                    #
-#             0   ASE server is alive                                              #
-#             1   ASE server is down                                               #
-# Description: This function is used to run deep probe to make sure the ASE server #
-#              still has response.                                                 #
-####################################################################################
-deep_probe()
-{
-	declare -i rv
-	
-	ocf_log debug "ASEHAagent: Start 'deep_probe'."	
-
-	# Declare two temporary files which will be used in this probe.
-	tmpfile1="$(mktemp /tmp/ASEHAagent.1.XXXXXX)"
-	tmpfile2="$(mktemp /tmp/ASEHAagent.2.XXXXXX)"
-	
-	# Get the login_string by analyzing the login_file.
-	get_login_string
-	if [[ $? = 1 ]]
-	then
-		# Login string cannot be fetched. Cannot continue the deep probe.
-		ocf_log err "ASEHAagent: Cannot run the deep probe because of incorrect login file $OCF_RESKEY_login_file. Deep probe failed."
-		return 1
-	fi
-
-	rm -f $tmpfile1
-	rm -f $tmpfile2
-
-	# The login file is correct. We have gotten the login account and password from it.
-	# Run isql command in background.
-	su $OCF_RESKEY_sybase_user -c ksh << EOF
-		# set required SYBASE environment by running SYBASE.sh.
-		. $OCF_RESKEY_sybase_home/SYBASE.sh
-		# Run a very simple SQL statement to make sure the server is still ok. The output will be put to
-		# tmpfile1.
-		(echo "select 1"; echo "go") |
-		\$SYBASE/\$SYBASE_OCS/bin/isql $login_string -S$OCF_RESKEY_server_name -I$OCF_RESKEY_interfaces_file -t $OCF_RESKEY_deep_probe_timeout -e -o$tmpfile1 &
-		# Record the isql command process id to temporary file. If the isql is hung, we need this process id
-                # to kill the hung process.
-		echo \$! > $tmpfile2	
-EOF
-	
-	declare -i t=0
-		
-	# Monitor the output file tmpfile1.
-	while [[ $t -lt $OCF_RESKEY_deep_probe_timeout ]]
-	do
-		# If the SQL statement is executed successfully, we will get the following output:
-		# 1> select 1
-		# 
-		# -----------
-		#           1
-		# 
-		# (1 row affected)
-		# So, we determine if the execution is success by searching the keyword "(1 row affected)".
-		grep "(1 row affected)" $tmpfile1
-		if [[ $? = 0 ]]
-		then
-			ocf_log debug "ASEHAagent: Deep probe sucess."
-			break
-		else
-			sleep 1
-			t=`expr $t+1`
-		fi
-	done	
-
-	# If $t is larger than deep_probe_timeout, it means the isql command line cannot finish in given time.
-	# This means the deep probe failed. We need to kill the isql process manually.
-	if [[ $t -ge $OCF_RESKEY_deep_probe_timeout ]]
-	then
-		ocf_log err "ASEHAagent: Deep probe fail. The dataserver has no response."		
-
-		# Read the process id of isql process from tmpfile2
-		pid=`cat $tmpfile2 | awk '{print $1}'`
-
-		rm -f $tmpfile1
-		rm -f $tmpfile2
-
-		# Kill the isql process directly.
-		kill -9 $pid
-		return 1
-	fi
-
-	rm -f $tmpfile1
-	rm -f $tmpfile2
-
-	ocf_log debug "ASEHAagent: End 'deep_probe'."
-
-	return 0
-}
-
-trap terminate SIGTERM
-
-#############################
-# Do some real work here... #
-#############################
-case $1 in
-	start)
-		verify_all || exit 1
-		ase_start
-		exit $?
-		;;
-	stop)
-		verify_all || exit 1
-		ase_stop
-		exit $?
-		;;
-	status | monitor)
-		verify_all || exit 1
-		ase_status $OCF_CHECK_LEVEL
-		exit $?
-		;;
-	kill)
-		kill_ase $OCF_RESKEY_shutdown_timeout
-		;;
-	meta-data)
-		meta_data
-		exit $?
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	*)
-		echo "Usage: $SCRIPT {start|stop|monitor|status|validate-all|meta-data}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
-exit 0
-
diff --git a/rgmanager/src/resources/Makefile b/rgmanager/src/resources/Makefile
deleted file mode 100644
index c7de361..0000000
--- a/rgmanager/src/resources/Makefile
+++ /dev/null
@@ -1,109 +0,0 @@
-TARGET1=utils/config-utils.sh
-TARGET2=fs.sh
-TARGET3=oracledb.sh
-
-all: $(TARGET1) $(TARGET2) $(TARGET3)
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/clean.mk
-
-RESOURCES=service.sh ip.sh nfsclient.sh nfsexport.sh \
-	script.sh netfs.sh clusterfs.sh smb.sh \
-	apache.sh openldap.sh samba.sh mysql.sh \
-	postgres-8.sh tomcat-5.sh tomcat-6.sh lvm.sh \
-	vm.sh SAPInstance SAPDatabase named.sh \
-	ASEHAagent.sh drbd.sh nfsserver.sh
-
-METADATA=apache.metadata openldap.metadata samba.metadata \
-	mysql.metadata postgres-8.metadata tomcat-5.metadata \
-	tomcat-6.metadata named.metadata lvm.metadata drbd.metadata
-
-EVENT_TARGETS= \
-	default_event_script.sl \
-	follow-service.sl
-
-GENERAL_TARGETS=ocf-shellfuncs svclib_nfslock lvm_by_lv.sh lvm_by_vg.sh
-
-UTIL_TARGETS= \
-	utils/ra-skelet.sh utils/messages.sh \
-	utils/httpd-parse-config.pl utils/tomcat-parse-config.pl \
-	utils/member_util.sh utils/fs-lib.sh
-
-$(TARGET1):
-	mkdir -p utils
-	cat $(S)/$(TARGET1).in | sed \
-		-e 's#@CONFDIR@#${CONFDIR}#g' \
-		-e 's#@CONFFILE@#${CONFFILE}#g' \
-	> $(TARGET1)
-
-$(TARGET2):
-	cat $(S)/$(TARGET2).in | sed \
-		-e 's#@LOGDIR@#${logdir}#g' \
-	> $(TARGET2)
-
-$(TARGET3):
-	cat $(S)/$(TARGET3).in | sed \
-		-e 's#@LOGDIR@#${logdir}#g' \
-	> $(TARGET3)
-
-install:
-	install -d ${sharedir}/utils
-	set -e; \
-	for i in $(RESOURCES); do \
-	 install -m755 $(S)/$$i ${sharedir}; \
-	done
-	set -e; \
-	for i in $(METADATA) $(EVENT_TARGETS); do \
-	 install -m644 $(S)/$$i ${sharedir}; \
-	done
-	set -e; \
-	for i in $(GENERAL_TARGETS); do \
-	 install -m755 $(S)/$$i ${sharedir}; \
-	done
-	set -e; \
-	for i in $(UTIL_TARGETS); do \
-	 install -m755 $(S)/$$i ${sharedir}/utils; \
-	done
-	install -m755 $(TARGET1) ${sharedir}/utils
-	install -m755 $(TARGET2) $(TARGET3) ${sharedir}
-
-uninstall:
-	${UNINSTALL} ${RESOURCES} ${GENERAL_TARGETS} \
-		     ${METADATA} ${EVENT_TARGETS} ${UTIL_TARGETS} \
-		     $(TARGET1) $(TARGET2) $(TARGET3) \
-		     ${sharedir}
-
-clean: generalclean
-	rm -f resources.rng
-
-check: $(RESOURCES) $(TARGET2) $(TARGET3) ra-api-1-modified.dtd
-	@echo Validating resource agent meta-data
-	@for f in $(RESOURCES) $(TARGET2) $(TARGET3); do \
-		echo "   ./$$f "; \
-		bash ./$$f meta-data | xmllint --dtdvalid \
-				  ./ra-api-1-modified.dtd --noout -; \
-		if [ $$? -ne 0 ]; then exit 1; fi \
-	done
-
-#
-# Schema maintenance.  Run 'make resources.rng' and paste it in to
-# config/tools/xml/cluster.rng.in where it says 'autogenerated'.
-#
-# resources.rng.* should never be distributed by themselves.
-#
-resources.rng: $(RESOURCES) $(TARGET2) $(TARGET3) ra2rng.xsl ra2ref.xsl
-	rm -f resources.rng
-	cat resources.rng.head >> resources.rng
-	@echo Generating per-resource RelaxNG information...
-	@for f in $(RESOURCES) $(TARGET2) $(TARGET3); do \
-		echo "    ./$$f"; \
-		bash ./$$f meta-data | xsltproc ra2rng.xsl - >> resources.rng; \
-	done
-	cat resources.rng.mid >> resources.rng
-	@echo Generating per-resource RelaxNG reference information...
-	@for f in $(RESOURCES) $(TARGET2) $(TARGET3); do \
-		echo "    ./$$f"; \
-		bash ./$$f meta-data | xsltproc ra2ref.xsl - >> resources.rng; \
-	done
-	cat resources.rng.tail >> resources.rng
-
diff --git a/rgmanager/src/resources/SAPDatabase b/rgmanager/src/resources/SAPDatabase
deleted file mode 100644
index e1249b8..0000000
--- a/rgmanager/src/resources/SAPDatabase
+++ /dev/null
@@ -1,1025 +0,0 @@
-#!/bin/sh
-#
-# SAPDatabase
-#
-# Description:	Manages any type of SAP supported database instance
-#               as a High-Availability OCF compliant resource.
-#
-# Author:       Alexander Krauth, October 2006
-# Support:      linux at sap.com
-# License:      GNU General Public License (GPL)
-# Copyright:    (c) 2006, 2007 Alexander Krauth
-#
-# An example usage: 
-#      See usage() function below for more details...
-#
-# OCF instance parameters:
-#	OCF_RESKEY_SID
-#       OCF_RESKEY_DIR_EXECUTABLE   (optional, well known directories will be searched by default)
-#       OCF_RESKEY_DBTYPE
-#       OCF_RESKEY_NETSERVICENAME   (optional, non standard name of Oracle Listener)
-#       OCF_RESKEY_DBJ2EE_ONLY      (optional, default is false)
-#       OCF_RESKEY_JAVA_HOME        (optional, only needed if DBJ2EE_ONLY is true and JAVA_HOME enviroment variable is not set)
-#       OCF_RESKEY_STRICT_MONITORING (optional, activate application level monitoring - with Oracle a failover will occur in case of an archiver stuck)
-#       OCF_RESKEY_AUTOMATIC_RECOVER (optional, automatic startup recovery, default is false)
-#       OCF_RESKEY_DIR_BOOTSTRAP    (optional, if non standard J2EE server directory)
-#       OCF_RESKEY_DIR_SECSTORE     (optional, if non standard J2EE secure store directory)
-#       OCF_RESKEY_DB_JARS          (optional, if maintained in bootstrap.properties, mandatory for WebAS Java 7.10)
-#	OCF_RESKEY_PRE_START_USEREXIT	(optional, lists a script which can be executed before the resource is started)
-#	OCF_RESKEY_POST_START_USEREXIT	(optional, lists a script which can be executed after the resource is started)
-#	OCF_RESKEY_PRE_STOP_USEREXIT	(optional, lists a script which can be executed before the resource is stopped)
-#	OCF_RESKEY_POST_STOP_USEREXIT	(optional, lists a script which can be executed after the resource is stopped)
-#
-# ToDo:
-# Remove all the database dependend stuff from the agent and use
-# saphostcontrol daemon as soon as SAP will release it.
-#
-#######################################################################
-# Initialization:
-
-if [ -f $(dirname $0)/.ocf-shellfuncs ]; then
-        . $(dirname $0)/.ocf-shellfuncs
-elif [ -f $(dirname $0)/ocf-shellfuncs ]; then
-        LC_ALL=C
-        LANG=C
-        PATH=/bin:/sbin:/usr/bin:/usr/sbin
-        export LC_ALL LANG PATH
-        . $(dirname $0)/ocf-shellfuncs
-else
-        echo Could not find ocf-shellfuncs!
-        exit 1
-fi
-
-#######################################################################
-
-SH=/bin/sh
-
-usage() {
-  methods=`sapdatabase_methods`
-  methods=`echo $methods | tr ' ' '|'`
-  cat <<-!
-	usage: $0 ($methods)
-
-	$0 manages a SAP database of any type as an HA resource.
-        Currently Oracle, MaxDB and DB/2 UDB are supported.
-        ABAP databases as well as JAVA only databases are supported.
-
-	The 'start' operation starts the instance.
-	The 'stop' operation stops the instance.
-	The 'status' operation reports whether the instance is running
-	The 'monitor' operation reports whether the instance seems to be working
-	The 'recover' operation tries to recover the instance after a crash (instance will be stopped first!)
-	The 'validate-all' operation reports whether the parameters are valid
-	The 'methods' operation reports on the methods $0 supports
-
-	!
-}
-
-meta_data() {
-	cat <<END
-<?xml version="1.0"?>
-<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-<resource-agent name="SAPDatabase">
-<version>1.92.1</version>
-
-<longdesc lang="en">
-Resource script for SAP databases. It manages a SAP database of any type as an HA resource.
-</longdesc>
-<shortdesc lang="en">SAP database resource agent</shortdesc>
-
-<parameters>
- <parameter name="SID" unique="1" required="1" primary="1">
-  <longdesc lang="en">The unique SAP system identifier. e.g. P01</longdesc>
-  <shortdesc lang="en">SAP system ID</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DIR_EXECUTABLE" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find sapstartsrv and sapcontrol.</longdesc>
-  <shortdesc lang="en">path of sapstartsrv and sapcontrol</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DBTYPE" unique="0" required="1">
-  <longdesc lang="en">The name of the database vendor you use. Set either: ORA,DB6,ADA</longdesc>
-  <shortdesc lang="en">database vendor</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="NETSERVICENAME" unique="0" required="0">
-  <longdesc lang="en">The Oracle TNS listener name.</longdesc>
-  <shortdesc lang="en">listener name</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DBJ2EE_ONLY" unique="0" required="0">
-  <longdesc lang="en">If you do not have a ABAP stack installed in the SAP database, set this to TRUE</longdesc>
-  <shortdesc lang="en">only JAVA stack installed</shortdesc>
-  <content type="boolean" default="false"/>
- </parameter>
- <parameter name="JAVA_HOME" unique="0" required="0">
-  <longdesc lang="en">This is only needed if the DBJ2EE_ONLY parameter is set to true. Enter the path to the Java SDK which is used by the SAP WebAS Java</longdesc>
-  <shortdesc lang="en">Path to Java SDK</shortdesc>
-  <content type="string" default=""/>
- </parameter>
- <parameter name="STRICT_MONITORING" unique="0" required="0">
-  <longdesc lang="en">This controls how the resource agent monitors the database. If set to true, it will use SAP tools to test the connect to the database. Do not use with Oracle, because it will result in unwanted failovers in case of an archiver stuck</longdesc>
-  <shortdesc lang="en">Activates application level monitoring</shortdesc>
-  <content type="boolean" default="false"/>
- </parameter>
- <parameter name="AUTOMATIC_RECOVER" unique="0" required="0">
-  <longdesc lang="en">The SAPDatabase resource agent tries to recover a failed start attempt automaticaly one time. This is done by running a forced abort of the RDBMS and/or executing recovery commands.</longdesc>
-  <shortdesc lang="en">Enable or disable automatic startup recovery</shortdesc>
-  <content type="boolean" default="false"/>
- </parameter>
- <parameter name="DIR_BOOTSTRAP" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find the J2EE instance bootstrap directory. e.g. /usr/sap/P01/J00/j2ee/cluster/bootstrap</longdesc>
-  <shortdesc lang="en">path to j2ee bootstrap directory</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DIR_SECSTORE" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find the J2EE security store directory. e.g. /usr/sap/P01/SYS/global/security/lib/tools</longdesc>
-  <shortdesc lang="en">path to j2ee secure store directory</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DB_JARS" unique="0" required="0">
-  <longdesc lang="en">The full qualified filename of the jdbc driver for the database connection test. It will be automaticaly read from the bootstrap.properties file in Java engine 6.40 and 7.00. For Java engine 7.10 the parameter is mandatory.</longdesc>
-  <shortdesc lang="en">file name of the jdbc driver</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="PRE_START_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed before this resource gets started.</longdesc>
-  <shortdesc lang="en">path to a pre-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="POST_START_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed after this resource got started.</longdesc>
-  <shortdesc lang="en">path to a post-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="PRE_STOP_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed before this resource gets stopped.</longdesc>
-  <shortdesc lang="en">path to a pre-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="POST_STOP_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed after this resource got stopped.</longdesc>
-  <shortdesc lang="en">path to a post-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
-</parameters>
-
-<actions>
-<action name="start" timeout="1800" />
-<action name="stop" timeout="1800" />
-<action name="status" depth="0" timeout="60" interval="120" start-delay="180" />
-<action name="monitor" depth="0" timeout="60" interval="120" start-delay="180" />
-<action name="validate-all" timeout="5" />
-<action name="meta-data" timeout="5" />
-<action name="methods" timeout="5" />
-</actions>
-</resource-agent>
-END
-}
-
-trap_handler() {
-  rm -f $TEMPFILE
-  exit $OCF_ERR_GENERIC
-}
-
-
-do_exit() {
-  # If we've got a tempfile variable and the tempfile exists...
-  #  ... if the return code is 0 *or* the temp file is empty
-  #    remove it.
-  if [ -n "$TEMPFILE" ] && [ -e "$TEMPFILE" ]; then
-    if [ $1 -eq 0 ] || [ "$(stat -c %s $TEMPFILE)" = "0" ]; then
-      rm -f $TEMPFILE
-    fi
-  fi
-  exit $1
-}
-
-
-#
-# listener_start: Start the given listener
-#
-listener_start() {
-  orasid="ora`echo $SID | tr [:upper:] [:lower:]`"
-  rc=$OCF_SUCCESS
-  output=`echo "lsnrctl start $NETSERVICENAME" | su - $orasid 2>&1`
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "Oracle Listener $NETSERVICENAME started: $output"
-    rc=$OCF_SUCCESS
-  else
-    ocf_log err "Oracle Listener $NETSERVICENAME start failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# listener_stop: Stop the given listener
-#
-listener_stop() {
-  orasid="ora`echo $SID | tr [:upper:] [:lower:]`"
-  rc=$OCF_SUCCESS
-  if
-      listener_status
-  then
-      : listener is running, trying to stop it later...
-  else
-      return $OCF_SUCCESS
-  fi
-  output=`echo "lsnrctl stop $NETSERVICENAME" | su - $orasid 2>&1`
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "Oracle Listener $NETSERVICENAME stopped: $output"
-  else
-    ocf_log err "Oracle Listener $NETSERVICENAME stop failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# listener_status: is the given listener running?
-#
-listener_status() {
-  orasid="ora`echo $SID | tr [:upper:] [:lower:]`"
-  # Note: ps cuts off it's output at column $COLUMNS, so "ps -ef" can not be used here
-  # as the output might be to long.
-  cnt=`ps efo args --user $orasid | grep $NETSERVICENAME | grep -c tnslsnr`
-  if [ $cnt -eq 1 ]
-  then
-    rc=$OCF_SUCCESS
-  else
-    ocf_log info "listener process not running for $NETSERVICENAME for $SID"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# x_server_start: Start the given x_server
-#
-x_server_start() {
-  rc=$OCF_SUCCESS
-  output=`echo "x_server start" | su - $sidadm 2>&1`
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "MaxDB x_server start: $output"
-    rc=$OCF_SUCCESS
-  else
-    ocf_log err "MaxDB x_server start failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# x_server_stop: Stop the x_server
-#
-x_server_stop() {
-  rc=$OCF_SUCCESS
-  output=`echo "x_server stop" | su - $sidadm 2>&1`
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "MaxDB x_server stop: $output"
-  else
-    ocf_log err "MaxDB x_server stop failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# x_server_status: is the x_server running?
-#
-x_server_status() {
-  sdbuser=`grep "^SdbOwner" /etc/opt/sdb | awk -F'=' '{print $2}'`
-  # Note: ps cuts off it's output at column $COLUMNS, so "ps -ef" can not be used here
-  # as the output might be to long.
-  cnt=`ps efo args --user $sdbuser | grep -c vserver`
-  if [ $cnt -ge 1 ]
-  then
-    rc=$OCF_SUCCESS
-  else
-    ocf_log info "x_server process not running"
-    rc=$OCF_ERR_GENERIC
-  fi
-  return $rc
-}
-
-#
-# oracle_stop: Stop the Oracle database without any condition
-#
-oracle_stop() {
-echo '#!/bin/sh
-LOG=$HOME/stopdb.log
-date > $LOG
-
-if [ -x "${ORACLE_HOME}/bin/sqlplus" ]
-then
-    SRVMGRDBA_EXE="${ORACLE_HOME}/bin/sqlplus"
-else
-   echo "Can not find executable sqlplus" >> $LOG
-   exit 1
-fi
-
-$SRVMGRDBA_EXE /NOLOG >> $LOG << !
-connect / as sysdba
-shutdown immediate
-exit
-!
-rc=$?
-cat $LOG
-exit $rc' > $TEMPFILE
-
-chmod 700 $TEMPFILE
-chown $sidadm $TEMPFILE
-
-su - $sidadm -c $TEMPFILE
-retcode=$?
-rm -f $TEMPFILE
-
-if [ $retcode -eq 0 ]; then
-  sapdatabase_status
-  if [ $? -ne $OCF_NOT_RUNNING ]; then
-    retcode=1
-  fi
-fi
-
-return $retcode
-}
-
-#
-# maxdb_stop: Stop the MaxDB database without any condition
-#
-maxdb_stop() {
-
-# x_Server must be running to stop database
-x_server_status
-if [ $? -ne $OCF_SUCCESS ]; then x_server_start; fi
-
-if [ $DBJ2EE_ONLY -eq 1 ]; then
-   userkey=c_J2EE
-else
-   userkey=c
-fi
-
-echo "#!/bin/sh
-LOG=\$HOME/stopdb.log
-date > \$LOG
-echo \"Stop database with xuserkey >$userkey<\" >> \$LOG
-dbmcli -U ${userkey} db_offline >> \$LOG 2>&1
-exit \$?" > $TEMPFILE
-
-chmod 700 $TEMPFILE
-chown $sidadm $TEMPFILE
-
-su - $sidadm -c $TEMPFILE
-retcode=$?
-rm -f $TEMPFILE
-
-if [ $retcode -eq 0 ]; then
-  sapdatabase_status
-  if [ $? -ne $OCF_NOT_RUNNING ]; then
-    retcode=1
-  fi
-fi
-
-return $retcode
-}
-
-#
-# db6udb_stop: Stop the DB2/UDB database without any condition
-#
-db6udb_stop() {
-echo '#!/bin/sh
-LOG=$HOME/stopdb.log
-date > $LOG
-echo "Shut down the database" >> $LOG
-$INSTHOME/sqllib/bin/db2 deactivate database $DB2DBDFT |tee -a $LOG  2>&1
-$INSTHOME/sqllib/adm/db2stop force |tee -a $LOG  2>&1
-exit $?' > $TEMPFILE
-
-chmod 700 $TEMPFILE
-chown $sidadm $TEMPFILE
-
-su - $sidadm -c $TEMPFILE
-retcode=$?
-rm -f $TEMPFILE
-
-if [ $retcode -eq 0 ]; then
-  sapdatabase_status
-  if [ $? -ne $OCF_NOT_RUNNING ]; then
-    retcode=1
-  fi
-fi
-
-return $retcode
-}
-
-#
-# oracle_recover: try to clean up oracle after a crash
-#
-oracle_recover() {
-echo '#!/bin/sh
-LOG=$HOME/recover.log
-date > $LOG
-echo "Logfile written by heartbeat SAPDatabase resource agent" >> $LOG
-
-if [ -x "${ORACLE_HOME}/bin/sqlplus" ]
-then
-    SRVMGRDBA_EXE="${ORACLE_HOME}/bin/sqlplus"
-else
-   echo "Can not find executable sqlplus" >> $LOG
-   exit 1
-fi
-
-$SRVMGRDBA_EXE /NOLOG >> $LOG << !
-connect / as sysdba
-shutdown abort
-startup mount
-WHENEVER SQLERROR EXIT SQL.SQLCODE
-WHENEVER OSERROR EXIT FAILURE
-alter database recover automatic database;
-alter database open;
-exit
-!
-rc=$?
-cat $LOG
-exit $rc' > $TEMPFILE
-
-  chmod 700 $TEMPFILE
-  chown $sidadm $TEMPFILE
-
-  su - $sidadm -c $TEMPFILE
-  retcode=$?
-  rm -f $TEMPFILE
-
-  return $retcode
-}
-
-#
-# maxdb_recover: try to clean up MaxDB after a crash
-#
-maxdb_recover() {
-  # x_Server must be running to stop database
-  x_server_status
-  if [ $? -ne $OCF_SUCCESS ]; then x_server_start; fi
-
-  if [ $DBJ2EE_ONLY -eq 1 ]; then
-     userkey=c_J2EE
-  else
-     userkey=c
-  fi
-
-echo "#!/bin/sh
-LOG=\$HOME/recover.log
-date > \$LOG
-echo \"Logfile written by heartbeat SAPDatabase resource agent\" >> \$LOG
-echo \"Cleanup database with xuserkey >$userkey<\" >> \$LOG
-echo \"db_stop\" >> \$LOG 2>&1
-dbmcli -U ${userkey} db_stop >> \$LOG 2>&1
-echo \"db_clear\" >> \$LOG 2>&1
-dbmcli -U ${userkey} db_clear >> \$LOG 2>&1
-echo \"db_online\" >> \$LOG 2>&1
-dbmcli -U ${userkey} db_online >> \$LOG 2>&1
-rc=\$?
-cat \$LOG
-exit \$rc" > $TEMPFILE
-
-  chmod 700 $TEMPFILE
-  chown $sidadm $TEMPFILE
-
-  su - $sidadm -c $TEMPFILE
-  retcode=$?
-  rm -f $TEMPFILE
-
-  return $retcode
-}
-
-#
-# db6udb_recover: try to recover DB/2 after a crash
-#
-db6udb_recover() {
-  db2sid="db2`echo $SID | tr [:upper:] [:lower:]`"
-
-echo '#!/bin/sh
-LOG=$HOME/recover.log
-date > $LOG
-echo "Logfile written by heartbeat SAPDatabase resource agent" >> $LOG
-$INSTHOME/sqllib/bin/db2_kill >> $LOG  2>&1
-$INSTHOME/sqllib/adm/db2start >> $LOG  2>&1
-$INSTHOME/sqllib/bin/db2 activate database $DB2DBDFT >> $LOG  2>&1
-rc=$?
-cat $LOG
-exit $rc' > $TEMPFILE
-
-  chmod 700 $TEMPFILE
-  chown $db2sid $TEMPFILE
-
-  su - $db2sid -c $TEMPFILE
-  retcode=$?
-  rm -f $TEMPFILE
-
-  return $retcode
-}
-
-#
-# methods: What methods/operations do we support?
-#
-sapdatabase_methods() {
-  cat <<-!
-	start
-	stop
-	status
-	monitor
-	recover
-	validate-all
-	methods
-	meta-data
-	usage
-	!
-}
-
-
-#
-# sapuserexit : Many SAP customers need some additional processes/tools to run their SAP systems.
-#               This specialties do not allow a totally generic SAP cluster resource agent.
-#               Someone should write a resource agent for each additional process you need, if it
-#               is required to monitor that process within the cluster manager. To enable
-#               you to extent this resource agent without developing a new one, this user exit
-#               was introduced.
-#
-sapuserexit() {
-  NAME="$1"
-  VALUE="$2"
-
-  if [ -n "$VALUE" ]
-  then
-    if [ -x "$VALUE" ]
-    then
-      ocf_log info "Calling userexit ${NAME} with customer script file ${VALUE}"
-      eval "$VALUE" > /dev/null 2>&1
-      ocf_log info "Exiting userexit ${NAME} with customer script file ${VALUE}, returncode: $?"
-    else
-      ocf_log warn "Attribute ${NAME} is set to ${VALUE}, but this file is not executable"
-    fi
-  fi
-  return 0
-}
-
-
-#
-# sapdatabase_start : Start the SAP database
-#
-sapdatabase_start() {
-  sapuserexit PRE_START_USEREXIT "$OCF_RESKEY_PRE_START_USEREXIT"
-
-  case $DBTYPE in
-    ADA) x_server_start
-         ;;
-    ORA) listener_start
-         ;;
-  esac
-
-  output=`su - $sidadm -c $SAPSTARTDB`
-  rc=$?
-
-  if [ $DBJ2EE_ONLY -eq 1 ]
-  then
-    sapdatabase_monitor 1
-    rc=$?
-  fi
-
-  if [ $rc -ne 0 -a $OCF_RESKEY_AUTOMATIC_RECOVER -eq 1 ]
-  then
-    ocf_log warn "SAP database $SID start failed: $output"
-    ocf_log warn "Try to recover database $SID"
-
-    output=''
-    sapdatabase_recover
-    rc=$?
-  fi
-
-  if [ $rc -eq 0 ]
-  then
-    ocf_log info "SAP database $SID started: $output"
-    rc=$OCF_SUCCESS
-    sapuserexit POST_START_USEREXIT "$OCF_RESKEY_POST_START_USEREXIT"
-  else
-    ocf_log err "SAP database $SID start failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-
-  return $rc
-}
-
-#
-# sapdatabase_stop: Stop the SAP database
-#
-sapdatabase_stop() {
-
-  sapuserexit PRE_STOP_USEREXIT "$OCF_RESKEY_PRE_STOP_USEREXIT"
-
-  # use of the stopdb kernel script is not possible, because there are to may checks in that
-  # script. We want to stop the database regardless of anything.
-  #output=`su - $sidadm -c $SAPSTOPDB`
-
-  case $DBTYPE in
-    ORA) output=`oracle_stop`
-         ;;
-    ADA) output=`maxdb_stop`
-         ;;
-    DB6) output=`db6udb_stop`
-         ;;
-  esac
-
-  if [ $? -eq 0 ]
-  then
-    ocf_log info "SAP database $SID stopped: $output"
-    rc=$OCF_SUCCESS
-  else
-    ocf_log err "SAP database $SID stop failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-
-  case $DBTYPE in
-    ORA) listener_stop
-         ;;
-    ADA) x_server_stop
-         ;;
-  esac
-
-  sapuserexit POST_STOP_USEREXIT "$OCF_RESKEY_POST_STOP_USEREXIT"
-
-  return $rc
-}
-
-
-#
-# sapdatabase_monitor: Can the given database instance do anything useful?
-#
-sapdatabase_monitor() {
-  strict=$1
-  rc=$OCF_SUCCESS
-
-  case $DBTYPE in
-    ADA) x_server_status 
-         if [ $? -ne $OCF_SUCCESS ]; then x_server_start; fi
-         ;;
-    ORA) listener_status
-         if [ $? -ne $OCF_SUCCESS ]; then listener_start; fi
-         ;;
-  esac
-
-  if [ $strict -eq 0 ]
-  then
-    sapdatabase_status
-    rc=$?
-  else
-    if [ $DBJ2EE_ONLY -eq 0 ]
-    then
-      output=`echo "$SAPDBCONNECT -d -w /dev/null" | su $sidadm 2>&1`
-      if [ $? -le 4 ]
-      then
-        rc=$OCF_SUCCESS
-      else
-        rc=$OCF_NOT_RUNNING
-      fi
-    else
-      MYCP=""
-      EXECMD=""
-
-      # WebAS Java 6.40+7.00
-      IAIK_JCE="$SECSTORE"/iaik_jce.jar
-      IAIK_JCE_EXPORT="$SECSTORE"/iaik_jce_export.jar
-      EXCEPTION="$BOOTSTRAP"/exception.jar
-      LOGGING="$BOOTSTRAP"/logging.jar
-      OPENSQLSTA="$BOOTSTRAP"/opensqlsta.jar
-      TC_SEC_SECSTOREFS="$BOOTSTRAP"/tc_sec_secstorefs.jar
-      JDDI="$BOOTSTRAP"/../server0/bin/ext/jdbdictionary/jddi.jar
-      ANTLR="$BOOTSTRAP"/../server0/bin/ext/antlr/antlr.jar
-      FRAME="$BOOTSTRAP"/../server0/bin/system/frame.jar
-  
-      # only start jdbcconnect when all jars available
-      if [ -f "$EXCEPTION" -a -f "$LOGGING" -a -f "$OPENSQLSTA" -a -f "$TC_SEC_SECSTOREFS" -a -f "$JDDI" -a -f "$ANTLR" -a -f "$FRAME" -a -f "$SAPDBCONNECT" ]
-      then
-        MYCP=".:$FRAME:$ANTLR:$JDDI:$IAIK_JCE_EXPORT:$IAIK_JCE:$EXCEPTION:$LOGGING:$OPENSQLSTA:$TC_SEC_SECSTOREFS:$DB_JARS:$SAPDBCONNECT" 
-        EXECMD="com.sap.inst.jdbc.connect.JdbcCon -sec $SID:$SID"
-      else
-      # WebAS Java 7.10
-        LAUNCHER=${BOOTSTRAP}/sap.com~tc~bl~offline_launcher~impl.jar
-
-        if [ -f "$DB_JARS" -a -f "$SAPDBCONNECT" -a -f "$LAUNCHER" ]
-        then
-          MYCP="$LAUNCHER"
-          EXECMD="com.sap.engine.offline.OfflineToolStart com.sap.inst.jdbc.connect.JdbcCon ${SAPDBCONNECT}:${SECSTORE}:${DB_JARS}:${BOOTSTRAP} -sec $SID:$SID"
-        fi
-      fi
-
-      if [ -n "$EXECMD" ]
-      then
-        output=`eval ${JAVA_HOME}/bin/java -cp $MYCP $EXECMD`
-        if [ $? -le 0 ]
-        then
-          rc=$OCF_SUCCESS
-        else
-          rc=$OCF_NOT_RUNNING
-        fi
-      else
-        output="Cannot find all jar files needed for database monitoring."
-        rc=$OCF_ERR_GENERIC
-      fi
-    fi
-  fi
-
-  if [ $rc -ne $OCF_SUCCESS ]
-  then
-    ocf_log err "The SAP database $SID ist not running: $output"
-  fi
-  return $rc
-}
-
-
-#
-# sapdatabase_status: Are there any database processes on this host ?
-#
-sapdatabase_status() {
-  case $DBTYPE in
-    ADA) SEARCH="$SID/db/pgm/kernel"
-         SUSER=`grep "^SdbOwner" /etc/opt/sdb | awk -F'=' '{print $2}'`
-         SNUM=2
-         ;;
-    ORA) SEARCH="ora_[a-z][a-z][a-z][a-z]_"
-         SUSER="ora`echo $SID | tr [:upper:] [:lower:]`"
-         SNUM=4
-         ;;
-    DB6) SEARCH="db2[a-z][a-z][a-z][a-z][a-z]"
-         SUSER="db2`echo $SID | tr [:upper:] [:lower:]`"
-         SNUM=5
-         ;;
-  esac
-
-  # Note: ps cuts off it's output at column $COLUMNS, so "ps -ef" can not be used here
-  # as the output might be to long.
-  cnt=`ps efo args --user $SUSER 2> /dev/null | grep -c "$SEARCH"`
-  if [ $cnt -ge $SNUM ]
-  then
-    rc=$OCF_SUCCESS
-  else
-    # ocf_log info "Database Instance $SID is not running on `hostname`"
-    rc=$OCF_NOT_RUNNING
-  fi
-  return $rc
-}
-
-
-#
-# sapdatabase_recover:
-#
-sapdatabase_recover() {
-
-  case $DBTYPE in
-    ORA) recoutput=`oracle_recover`
-         ;;
-    ADA) recoutput=`maxdb_recover`
-         ;;
-    DB6) recoutput=`db6udb_recover`
-         ;;
-  esac
-
-  sapdatabase_monitor 1
-  retcode=$?
-
-  if [ $retcode -eq $OCF_SUCCESS ]
-  then
-    ocf_log info "Recover of SAP database $SID was successful: $recoutput"
-  else
-    ocf_log err "Recover of SAP database $SID failed: $recoutput"
-  fi
-
-  return $retcode
-}
-
-
-#
-# sapdatabase_validate: Check the symantic of the input parameters 
-#
-sapdatabase_validate() {
-  rc=$OCF_SUCCESS
-  if [ `echo "$SID" | grep -c '^[A-Z][A-Z0-9][A-Z0-9]$'` -ne 1 ]
-  then
-    ocf_log err "Parsing parameter SID: '$SID' is not a valid system ID!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  case "$DBTYPE" in
-   ORA|ADA|DB6) ;;
-   *) ocf_log err "Parsing parameter DBTYPE: '$DBTYPE' is not a supported database type!"
-      rc=$OCF_ERR_ARGS ;;
-  esac
-
-  return $rc
-}
-
-
-#
-#	'main' starts here...
-#
-
-if
-  ( [ $# -ne 1 ] )
-then
-  usage
-  exit $OCF_ERR_ARGS
-fi
-
-# These operations don't require OCF instance parameters to be set
-case "$1" in
-  meta-data)	meta_data
-		exit $OCF_SUCCESS;;
-
-  usage) 	usage
-		exit $OCF_SUCCESS;;
-
-  methods)	sapdatabase_methods
-		exit $?;;
-
-  *);;
-esac
-
-# Set a tempfile and make sure to clean it up again
-TEMPFILE="$(mktemp /tmp/SAPDatabase.tmp.XXXXXX)"
-trap trap_handler INT TERM
-
-# Everything after here must call do_exit to remove temp file
-
-
-US=`id -u -n`
-US=`echo $US`
-if
-  [ $US != root  ]
-then
-  ocf_log err "$0 must be run as root"
-  do_exit $OCF_ERR_PERM
-fi
-
-# mandatory parameter check
-if  [ -z "$OCF_RESKEY_SID" ]; then
-  ocf_log err "Please set OCF_RESKEY_SID to the SAP system id!"
-  do_exit $OCF_ERR_ARGS
-fi
-SID=`echo "$OCF_RESKEY_SID"`
-
-if [ -z "$OCF_RESKEY_DBTYPE" ]; then
-  ocf_log err "Please set OCF_RESKEY_DBTYPE to the database vendor specific tag (ORA,ADA,DB6)!"
-  do_exit $OCF_ERR_ARGS
-fi
-DBTYPE=`echo "$OCF_RESKEY_DBTYPE" | tr "[a-z]" "[A-Z]"`
-
-# optional OCF parameters, we try to guess which directories are correct
-EXESTARTDB="startdb"
-EXESTOPDB="stopdb"
-EXEDBCONNECT="R3trans"
-if [ -z "$OCF_RESKEY_DBJ2EE_ONLY" ]; then
-  DBJ2EE_ONLY=0
-else
-  case "$OCF_RESKEY_DBJ2EE_ONLY" in
-   1|true|TRUE|yes|YES) DBJ2EE_ONLY=1
-                        EXESTARTDB="startj2eedb"
-                        EXESTOPDB="stopj2eedb"
-                        EXEDBCONNECT="jdbcconnect.jar"
-                        ;;
-   0|false|FALSE|no|NO) DBJ2EE_ONLY=0;;
-   *) ocf_log err "Parsing parameter DBJ2EE_ONLY: '$DBJ2EE_ONLY' is not a boolean value!"
-      do_exit $OCF_ERR_ARGS ;;
-  esac
-fi
-
-if [ -z "$OCF_RESKEY_NETSERVICENAME" ]; then
-  case "$DBTYPE" in
-    ORA|ora) NETSERVICENAME="LISTENER";;
-    *)       NETSERVICENAME="";;
-  esac
-else
-  NETSERVICENAME="$OCF_RESKEY_NETSERVICENAME"
-fi
-
-if [ -z "$OCF_RESKEY_STRICT_MONITORING" ]; then
-  OCF_RESKEY_STRICT_MONITORING=0
-else
-  case "$OCF_RESKEY_STRICT_MONITORING" in
-   1|true|TRUE|yes|YES) OCF_RESKEY_STRICT_MONITORING=1;;
-   0|false|FALSE|no|NO) OCF_RESKEY_STRICT_MONITORING=0;;
-   *)  ocf_log err "Parsing parameter STRICT_MONITORING: '$OCF_RESKEY_STRICT_MONITORING' is not a boolean value!"
-       do_exit $OCF_ERR_ARGS ;;
-  esac
-fi
-
-PATHLIST="
-$OCF_RESKEY_DIR_EXECUTABLE
-/usr/sap/$SID/*/exe
-/usr/sap/$SID/SYS/exe/run
-/sapmnt/$SID/exe
-"
-DIR_EXECUTABLE=""
-for EXEPATH in $PATHLIST
-do
-  if [ -x $EXEPATH/$EXESTARTDB -a -x $EXEPATH/$EXESTOPDB -a -x $EXEPATH/$EXEDBCONNECT ]
-  then
-    DIR_EXECUTABLE=$EXEPATH
-    SAPSTARTDB=$EXEPATH/$EXESTARTDB
-    SAPSTOPDB=$EXEPATH/$EXESTOPDB
-    SAPDBCONNECT=$EXEPATH/$EXEDBCONNECT
-    break
-  fi
-done
-if [ -z "$DIR_EXECUTABLE" ]
-then
-  ocf_log warn "Cannot find $EXESTARTDB,$EXESTOPDB and $EXEDBCONNECT executable, please set DIR_EXECUTABLE parameter!"
-  do_exit $OCF_NOT_RUNNING
-fi
-
-if [ $DBJ2EE_ONLY -eq 1 ]
-then
-  if [ -n "$OCF_RESKEY_DIR_BOOTSTRAP" ]
-  then
-    BOOTSTRAP="$OCF_RESKEY_DIR_BOOTSTRAP"
-  else
-    BOOTSTRAP=`echo /usr/sap/$SID/*/j2ee/cluster/bootstrap | head -1`
-  fi
-
-  if [ -n "$OCF_RESKEY_DIR_SECSTORE" ]
-  then
-    SECSTORE="$OCF_RESKEY_DIR_SECSTORE"
-  else
-    SECSTORE=/usr/sap/$SID/SYS/global/security/lib/tools
-  fi
-
-  if [ -n "$OCF_RESKEY_JAVA_HOME" ]
-  then
-    JAVA_HOME="$OCF_RESKEY_JAVA_HOME"
-    PATH=$JAVA_HOME/bin:$PATH
-  else
-    if [ -n "$JAVA_HOME" ]
-    then
-      PATH=$JAVA_HOME/bin:$PATH
-    else
-      ocf_log err "Cannot find JAVA_HOME directory, please set JAVA_HOME parameter!"
-      do_exit $OCF_NOT_RUNNING
-    fi
-  fi
-
-  if [ -n "$OCF_RESKEY_DB_JARS" ]
-  then
-    DB_JARS=$OCF_RESKEY_DB_JARS
-  else
-    if [ -f "$BOOTSTRAP"/bootstrap.properties ]; then
-      DB_JARS=`cat $BOOTSTRAP/bootstrap.properties | grep -i rdbms.driverLocation | sed -e 's/\\\:/:/g' | awk -F= '{print $2}'`
-    fi
-  fi
-fi
-
-if [ -z "$OCF_RESKEY_AUTOMATIC_RECOVER" ]
-then
-  OCF_RESKEY_AUTOMATIC_RECOVER=0
-else
-  case "$OCF_RESKEY_AUTOMATIC_RECOVER" in
-   1|true|TRUE|yes|YES) OCF_RESKEY_AUTOMATIC_RECOVER=1;;
-   0|false|FALSE|no|NO) OCF_RESKEY_AUTOMATIC_RECOVER=0;;
-  esac
-fi
-
-# as root user we need the library path to the SAP kernel to be able to call executables
-if [ `echo $LD_LIBRARY_PATH | grep -c "^$DIR_EXECUTABLE\>"` -eq 0 ]; then
-  LD_LIBRARY_PATH=$DIR_EXECUTABLE:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
-fi
-sidadm="`echo $SID | tr [:upper:] [:lower:]`adm"
-
-# What kind of method was invoked?
-case "$1" in
-
-  start)	sapdatabase_start
-		do_exit $?;;
-
-  stop)		sapdatabase_stop
-		do_exit $?;;
-
-  monitor)
-          	sapdatabase_monitor $OCF_RESKEY_STRICT_MONITORING
-		do_exit $?;;
-
-  status)
-                sapdatabase_status
-                do_exit $?;;
-
-  recover)      sapdatabase_recover
-                do_exit $?;;
-
-  validate-all)	sapdatabase_validate
-		do_exit $?;;
-
-  *)		sapdatabase_methods
-		do_exit $OCF_ERR_UNIMPLEMENTED;;
-esac
diff --git a/rgmanager/src/resources/SAPInstance b/rgmanager/src/resources/SAPInstance
deleted file mode 100644
index a97aaf6..0000000
--- a/rgmanager/src/resources/SAPInstance
+++ /dev/null
@@ -1,591 +0,0 @@
-#!/bin/sh
-#
-# SAPInstance
-#
-# Description:	Manages a single SAP Instance as a High-Availability
-#		resource. One SAP Instance is defined by one 
-#               SAP Instance-Profile. start/stop handels all services
-#               of the START-Profile, status and monitor care only
-#               about essential services.
-#
-# Author:       Alexander Krauth, June 2006
-# Support:      linux at sap.com
-# License:      GNU General Public License (GPL)
-# Copyright:    (c) 2006, 2007 Alexander Krauth
-#
-# An example usage: 
-#      See usage() function below for more details...
-#
-# OCF instance parameters:
-#	OCF_RESKEY_InstanceName
-#	OCF_RESKEY_DIR_EXECUTABLE   (optional, well known directories will be searched by default)
-#	OCF_RESKEY_DIR_PROFILE      (optional, well known directories will be searched by default)
-#	OCF_RESKEY_START_PROFILE    (optional, well known directories will be searched by default)
-#	OCF_RESKEY_START_WAITTIME   (optional, to solve timing problems during J2EE-Addin start)
-#	OCF_RESKEY_AUTOMATIC_RECOVER    (optional, automatic startup recovery using cleanipc, default is false)
-#	OCF_RESKEY_PRE_START_USEREXIT	(optional, lists a script which can be executed before the resource is started)
-#	OCF_RESKEY_POST_START_USEREXIT	(optional, lists a script which can be executed after the resource is started)
-#	OCF_RESKEY_PRE_STOP_USEREXIT	(optional, lists a script which can be executed before the resource is stopped)
-#	OCF_RESKEY_POST_STOP_USEREXIT	(optional, lists a script which can be executed after the resource is stopped)
-#
-#######################################################################
-# Initialization:
-
-if [ -f $(dirname $0)/.ocf-shellfuncs ]; then
-        . $(dirname $0)/.ocf-shellfuncs
-elif [ -f $(dirname $0)/ocf-shellfuncs ]; then
-        LC_ALL=C
-        LANG=C
-        PATH=/bin:/sbin:/usr/bin:/usr/sbin
-        export LC_ALL LANG PATH
-        . $(dirname $0)/ocf-shellfuncs
-else
-        echo Could not find ocf-shellfuncs!
-        exit 1
-fi
-
-
-#######################################################################
-
-SH=/bin/sh
-
-usage() {
-  methods=`sapinstance_methods`
-  methods=`echo $methods | tr ' ' '|'`
-  cat <<-!
-	usage: $0 ($methods)
-
-	$0 manages a SAP Instance as an HA resource.
-
-	The 'start' operation starts the instance.
-	The 'stop' operation stops the instance.
-	The 'status' operation reports whether the instance is running
-	The 'monitor' operation reports whether the instance seems to be working
-	The 'validate-all' operation reports whether the parameters are valid
-	The 'methods' operation reports on the methods $0 supports
-
-	!
-}
-
-meta_data() {
-	cat <<END
-<?xml version="1.0"?>
-<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
-<resource-agent name="SAPInstance">
-<version>1.92.1</version>
-
-<longdesc lang="en">
-Resource script for SAP. It manages a SAP Instance as an HA resource.
-</longdesc>
-<shortdesc lang="en">SAP instance resource agent</shortdesc>
-
-<parameters>
- <parameter name="InstanceName" unique="1" required="1" primary="1">
-  <longdesc lang="en">The full qualified SAP instance name. e.g. P01_DVEBMGS00_sapp01ci</longdesc>
-  <shortdesc lang="en">instance name: SID_INSTANCE_VIR-HOSTNAME</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DIR_EXECUTABLE" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find sapstartsrv and sapcontrol.</longdesc>
-  <shortdesc lang="en">path of sapstartsrv and sapcontrol</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="DIR_PROFILE" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find the SAP START profile.</longdesc>
-  <shortdesc lang="en">path of start profile</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="START_PROFILE" unique="0" required="0">
-  <longdesc lang="en">The name of the SAP START profile.</longdesc>
-  <shortdesc lang="en">start profile name</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="START_WAITTIME" unique="0" required="0">
-  <longdesc lang="en">After that time in seconds a monitor operation is executed by the resource agent. Does the monitor return SUCCESS, the start is handled as SUCCESS. This is useful to resolve timing problems with e.g. the J2EE-Addin instance.</longdesc>
-  <shortdesc lang="en">Check the successful start after that time (do not wait for J2EE-Addin)</shortdesc>
-  <content type="string" default="3600" />
- </parameter>
- <parameter name="AUTOMATIC_RECOVER" unique="0" required="0">
-  <longdesc lang="en">The SAPInstance resource agent tries to recover a failed start attempt automaticaly one time. This is done by killing runing instance processes and executing cleanipc.</longdesc>
-  <shortdesc lang="en">Enable or disable automatic startup recovery</shortdesc>
-  <content type="boolean" default="false"/>
- </parameter>
- <parameter name="PRE_START_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed before this resource gets started.</longdesc>
-  <shortdesc lang="en">path to a pre-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="POST_START_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed after this resource got started.</longdesc>
-  <shortdesc lang="en">path to a post-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="PRE_STOP_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed before this resource gets stopped.</longdesc>
-  <shortdesc lang="en">path to a pre-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
- <parameter name="POST_STOP_USEREXIT" unique="0" required="0">
-  <longdesc lang="en">The full qualified path where to find a script or program which should be executed after this resource got stopped.</longdesc>
-  <shortdesc lang="en">path to a post-start script</shortdesc>
-  <content type="string" default="" />
- </parameter>
-</parameters>
-
-<actions>
-<action name="start" timeout="180" />
-<action name="stop" timeout="240" />
-<action name="status" timeout="60" depth="0" interval="120" start-delay="240" />
-<action name="monitor" depth="0" timeout="60" interval="120" start-delay="240" />
-<action name="validate-all" timeout="5" />
-<action name="meta-data" timeout="5" />
-<action name="methods" timeout="5" />
-</actions>
-</resource-agent>
-END
-}
-
-
-#
-# methods: What methods/operations do we support?
-#
-sapinstance_methods() {
-  cat <<-!
-	start
-	stop
-	status
-	monitor
-	validate-all
-	methods
-	meta-data
-	usage
-	!
-}
-
-
-#
-# check_sapstartsrv : Before using sapcontrol we make sure that the sapstartsrv is running for the correct instance.
-#                     We cannot use sapinit and the /usr/sap/sapservices file in case of an enquerep instance,
-#                     because then we have two instances with the same instance number.
-#
-check_sapstartsrv() {
-  restart=0
-  runninginst=""
-  chkrc=$OCF_SUCCESS
-
-  output=`$SAPCONTROL -nr $InstanceNr -function ParameterValue INSTANCE_NAME -format script`
-  if [ $? -eq 0 ]
-  then
-    runninginst=`echo "$output" | grep '^0 : ' | cut -d' ' -f3`
-    if [ "$runninginst" != "$InstanceName" ]
-    then 
-      ocf_log warn "sapstartsrv is running for instance $runninginst, that service will be killed"
-      restart=1
-    fi
-  else
-    ocf_log warn "sapstartsrv is not running for instance $SID-$InstanceName, it will be started now"
-    restart=1
-  fi
-
-  if [ -z "$runninginst" ]; then runninginst=$InstanceName; fi
-
-  if [ $restart -eq 1 ]
-  then
-    pkill -9 -f "sapstartsrv.*$runninginst"
-    $SAPSTARTSRV pf=$SAPSTARTPROFILE -D -u $sidadm
-
-    # now make sure the daemon has been started and is able to respond
-    srvrc=1
-    while [ $srvrc -eq 1 -a `pgrep -f "sapstartsrv.*$runninginst" | wc -l` -gt 0 ]
-    do
-      sleep 1
-      $SAPCONTROL -nr $InstanceNr -function GetProcessList > /dev/null 2>&1
-      srvrc=$?
-    done
-
-    if [ $srvrc -ne 1 ]
-    then
-      ocf_log info "sapstartsrv for instance $SID-$InstanceName was restarted !"
-      chkrc=$OCF_SUCCESS
-    else
-      ocf_log error "sapstartsrv for instance $SID-$InstanceName could not be started!"
-      chkrc=$OCF_NOT_RUNNING
-    fi
-  fi
-
-  return $chkrc
-}
-
-
-#
-# sapuserexit : Many SAP customers need some additional processes/tools to run their SAP systems.
-#               This specialties do not allow a totally generic SAP cluster resource agent.
-#               Someone should write a resource agent for each additional process you need, if it
-#               is required to monitor that process within the cluster manager. To enable 
-#               you to extent this resource agent without developing a new one, this user exit
-#               was introduced.
-#
-sapuserexit() {
-  NAME="$1"
-  VALUE="$2"
-
-  if [ -n "$VALUE" ]
-  then
-    if [ -x "$VALUE" ]
-    then
-      ocf_log info "Calling userexit ${NAME} with customer script file ${VALUE}"
-      eval "$VALUE" > /dev/null 2>&1
-      ocf_log info "Exiting userexit ${NAME} with customer script file ${VALUE}, returncode: $?"
-    else
-      ocf_log warn "Attribute ${NAME} is set to ${VALUE}, but this file is not executable"
-    fi
-  fi
-  return 0
-}
-
-
-#
-# cleanup_instance : remove resources (processes and shared memory) from a crashed instance)
-#
-cleanup_instance() {
-  pkill -9 -f -U $sidadm $InstanceName
-  $DIR_EXECUTABLE/cleanipc $InstanceNr remove
-  return 0
-}
-
-#
-# sapinstance_start : Start the SAP instance
-#
-sapinstance_start() {
-
-  sapuserexit PRE_START_USEREXIT "$OCF_RESKEY_PRE_START_USEREXIT"
-
-  rc=$OCF_NOT_RUNNING
-  loopcount=0
-  while [ $loopcount -lt 2 ]
-  do
-    loopcount=$(($loopcount + 1))
-
-    check_sapstartsrv
-    output=`$SAPCONTROL -nr $InstanceNr -function Start`
-    rc=$?
-    ocf_log info "Starting SAP Instance $SID-$InstanceName: $output"
-
-    if [ $rc -ne 0 ]
-    then
-      ocf_log err "SAP Instance $SID-$InstanceName start failed."
-      return $OCF_ERR_GENERIC
-    fi
-
-    startrc=1
-    while [ $startrc -gt 0 ]
-    do
-      waittime_start=`date +%s`
-      output=`$SAPCONTROL -nr $InstanceNr -function WaitforStarted $OCF_RESKEY_START_WAITTIME 10`
-      startrc=$?
-      waittime_stop=`date +%s`
-
-      if [ $startrc -ne 0 ]
-      then
-        if [ $(($waittime_stop - $waittime_start)) -ge $OCF_RESKEY_START_WAITTIME ]
-        then
-          sapinstance_monitor NOLOG
-          if [ $? -eq $OCF_SUCCESS ]
-          then
-            output="START_WAITTIME ($OCF_RESKEY_START_WAITTIME) has elapsed, but instance monitor returned SUCCESS. Instance considered running."
-            startrc=0; loopcount=2
-          fi
-        else
-          if [ $loopcount -eq 1 -a $OCF_RESKEY_AUTOMATIC_RECOVER -eq 1 ]
-          then
-            ocf_log warn "SAP Instance $SID-$InstanceName start failed: $output"
-            ocf_log warn "Try to recover $SID-$InstanceName"
-            cleanup_instance
-          else
-            loopcount=2
-          fi
-          startrc=-1
-        fi
-      else
-        loopcount=2
-      fi
-    done
-  done
-
-  if [ $startrc -eq 0 ]
-  then
-    ocf_log info "SAP Instance $SID-$InstanceName started: $output"
-    rc=$OCF_SUCCESS
-    sapuserexit POST_START_USEREXIT "$OCF_RESKEY_POST_START_USEREXIT"
-  else
-    ocf_log err "SAP Instance $SID-$InstanceName start failed: $output"
-    rc=$OCF_NOT_RUNNING
-  fi
-
-  return $rc
-}
-
-
-#
-# sapinstance_recover: Try startup of failed instance by cleaning up resources
-#
-sapinstance_recover() {
-  cleanup_instance
-  sapinstance_start
-  return $?
-}
-
-
-#
-# sapinstance_stop: Stop the SAP instance
-#
-sapinstance_stop() {
-  sapuserexit PRE_STOP_USEREXIT "$OCF_RESKEY_PRE_STOP_USEREXIT"
-
-  check_sapstartsrv
-
-  output=`$SAPCONTROL -nr $InstanceNr -function Stop`
-  if [ $? -eq 0 ]
-  then
-    output=`$SAPCONTROL -nr $InstanceNr -function WaitforStopped 3600 1`
-    if [ $? -eq 0 ]
-    then
-      ocf_log info "SAP Instance $SID-$InstanceName stopped: $output"
-      rc=$OCF_SUCCESS
-    else
-      ocf_log err "SAP Instance $SID-$InstanceName stop failed: $output"
-      rc=$OCF_ERR_GENERIC
-    fi
-  else
-    ocf_log err "SAP Instance $SID-$InstanceName stop failed: $output"
-    rc=$OCF_ERR_GENERIC
-  fi
-
-  sapuserexit POST_STOP_USEREXIT "$OCF_RESKEY_POST_STOP_USEREXIT"
-
-  return $rc
-}
-
-
-#
-# sapinstance_monitor: Can the given SAP instance do anything useful?
-#
-sapinstance_monitor() {
-  MONLOG=$1
-  check_sapstartsrv
-  rc=$?
-
-  if [ $rc -eq $OCF_SUCCESS ]
-  then
-    count=0
-    LOCALHOST=`hostname`
-    output=`$SAPCONTROL -nr $InstanceNr -host $LOCALHOST -function GetProcessList -format script`
-
-    # we have to parse the output, because the returncode doesn't tell anything about the instance status
-    for SERVNO in `echo "$output" | grep '^[0-9] ' | cut -d' ' -f1 | sort -u`
-    do
-      COLOR=`echo "$output" | grep "^$SERVNO dispstatus: " | cut -d' ' -f3`
-      SERVICE=`echo "$output" | grep "^$SERVNO name: " | cut -d' ' -f3`
-      STATE=0
-
-      case $COLOR in
-        GREEN|YELLOW)       STATE=$OCF_SUCCESS;;
-        *)                  STATE=$OCF_NOT_RUNNING;;
-      esac 
-
-      case $SERVICE in
-        disp+work|msg_server|enserver|enrepserver|jcontrol|jstart)
-                      if [ $STATE -eq $OCF_NOT_RUNNING ]
-                      then
-                        if [ "$MONLOG" != "NOLOG" ]
-                        then
-                          ocf_log err "SAP instance service $SERVICE is not running with status $COLOR !"
-                        fi
-                        rc=$STATE
-                      fi
-                      count=1;;
-        *);;
-      esac
-    done
-
-    if [ $count -eq 0 -a $rc -eq $OCF_SUCCESS ]
-    then
-      if [ "$MONLOG" != "NOLOG" ]
-      then
-        ocf_log err "The SAP instance does not run any services which this RA could monitor!"
-      fi
-      rc=$OCF_ERR_ARGS
-    fi
-  fi
-  
-  return $rc
-}
-
-#
-# sapinstance_validate: Check the symantic of the input parameters 
-#
-sapinstance_validate() {
-  rc=$OCF_SUCCESS
-  if [ `echo "$SID" | grep -c '^[A-Z][A-Z0-9][A-Z0-9]$'` -ne 1 ]
-  then
-    ocf_log err "Parsing instance profile name: '$SID' is not a valid system ID!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  if [ `echo "$InstanceName" | grep -c '^[A-Z].*[0-9][0-9]$'` -ne 1 ]
-  then
-    ocf_log err "Parsing instance profile name: '$InstanceName' is not a valid instance name!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  if [ `echo "$InstanceNr" | grep -c '^[0-9][0-9]$'` -ne 1 ]
-  then
-    ocf_log err "Parsing instance profile name: '$InstanceNr' is not a valid instance number!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  if [ `echo "$SAPVIRHOST" | grep -c '^[A-Za-z][A-Za-z0-9_-]*$'` -ne 1 ]
-  then
-    ocf_log err "Parsing instance profile name: '$SAPVIRHOST' is not a valid hostname!"
-    rc=$OCF_ERR_ARGS
-  fi
-
-  return $rc
-}
-
-
-#
-#	'main' starts here...
-#
-
-if
-  ( [ $# -ne 1 ] )
-then
-  usage
-  exit $OCF_ERR_ARGS
-fi
-
-# These operations don't require OCF instance parameters to be set
-case "$1" in
-  meta-data)	meta_data
-		exit $OCF_SUCCESS;;
-
-  usage) 	usage
-		exit $OCF_SUCCESS;;
-
-  methods)	sapinstance_methods
-		exit $?;;
-
-  *);;
-esac
-
-US=`id -u -n`
-US=`echo $US`
-if
-  [ $US != root  ]
-then
-  ocf_log err "$0 must be run as root"
-  exit $OCF_ERR_PERM
-fi
-
-# parameter check
-if  [ -z "$OCF_RESKEY_InstanceName" ]
-then
-  ocf_log err "Please set OCF_RESKEY_InstanceName to the name to the SAP instance profile!"
-  exit $OCF_ERR_ARGS
-fi
-
-SID=`echo "$OCF_RESKEY_InstanceName" | cut -d_ -f1`
-InstanceName=`echo "$OCF_RESKEY_InstanceName" | cut -d_ -f2`
-InstanceNr=`echo "$InstanceName" | sed 's/.*\([0-9][0-9]\)$/\1/'`
-SAPVIRHOST=`echo "$OCF_RESKEY_InstanceName" | cut -d_ -f3`
-
-# optional OCF parameters, we try to guess which directories are correct
-if  [ -z "$OCF_RESKEY_DIR_EXECUTABLE" ]
-then
-  if [ -x /usr/sap/$SID/$InstanceName/exe/sapstartsrv -a -x /usr/sap/$SID/$InstanceName/exe/sapcontrol ]
-  then
-    DIR_EXECUTABLE="/usr/sap/$SID/$InstanceName/exe"
-    SAPSTARTSRV="/usr/sap/$SID/$InstanceName/exe/sapstartsrv"
-    SAPCONTROL="/usr/sap/$SID/$InstanceName/exe/sapcontrol"
-  elif [ -x /usr/sap/$SID/SYS/exe/run/sapstartsrv -a -x /usr/sap/$SID/SYS/exe/run/sapcontrol ]
-  then
-    DIR_EXECUTABLE="/usr/sap/$SID/SYS/exe/run"
-    SAPSTARTSRV="/usr/sap/$SID/SYS/exe/run/sapstartsrv"
-    SAPCONTROL="/usr/sap/$SID/SYS/exe/run/sapcontrol"
-  else
-    ocf_log warn "Cannot find sapstartsrv and sapcontrol executable, please set DIR_EXECUTABLE parameter!"
-    exit $OCF_NOT_RUNNING
-  fi
-else
-  DIR_EXECUTABLE="$OCF_RESKEY_DIR_EXECUTABLE"
-  SAPSTARTSRV="$OCF_RESKEY_DIR_EXECUTABLE/sapstartsrv"
-  SAPCONTROL="$OCF_RESKEY_DIR_EXECUTABLE/sapcontrol"
-fi
-
-if [ -z "$OCF_RESKEY_DIR_PROFILE" ]
-then
-  if [ -d /usr/sap/$SID/SYS/profile/ ]
-  then
-    DIR_PROFILE="/usr/sap/$SID/SYS/profile"
-  else
-    ocf_log warn "Expected /usr/sap/$SID/SYS/profile/ to be a directory, please set DIR_PROFILE parameter!"
-    exit $OCF_NOT_RUNNING
-  fi
-else
-  DIR_PROFILE="$OCF_RESKEY_DIR_PROFILE"
-fi
-
-if [ -z "$OCF_RESKEY_START_PROFILE" ]
-then
-  SAPSTARTPROFILE="$DIR_PROFILE/START_${InstanceName}_${SAPVIRHOST}"
-  if [ ! -r $SAPSTARTPROFILE ]
-  then
-    ocf_log warn "Expected $SAPSTARTPROFILE to be the instance START profile, please set START_PROFILE parameter!"
-    exit $OCF_NOT_RUNNING
-  fi
-else
-  SAPSTARTPROFILE="$OCF_RESKEY_START_PROFILE"
-fi
-
-if [ -z "$OCF_RESKEY_START_WAITTIME" ]
-then
-  OCF_RESKEY_START_WAITTIME=3600
-fi
-
-
-if [ -z "$OCF_RESKEY_AUTOMATIC_RECOVER" ]
-then
-  OCF_RESKEY_AUTOMATIC_RECOVER=0
-else
-  case "$OCF_RESKEY_AUTOMATIC_RECOVER" in
-   1|true|TRUE|yes|YES) OCF_RESKEY_AUTOMATIC_RECOVER=1;;
-   0|false|FALSE|no|NO) OCF_RESKEY_AUTOMATIC_RECOVER=0;;
-  esac
-fi
-
-# as root user we need the library path to the SAP kernel to be able to call sapcontrol
-if [ `echo $LD_LIBRARY_PATH | grep -c "^$DIR_EXECUTABLE\>"` -eq 0 ]; then
-  LD_LIBRARY_PATH=$DIR_EXECUTABLE:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
-fi
-sidadm="`echo $SID | tr [:upper:] [:lower:]`adm"
-
-# What kind of method was invoked?
-case "$1" in
-
-  start)	sapinstance_start
-		exit $?;;
-
-  stop)		sapinstance_stop
-		exit $?;;
-
-  status|monitor)
-          	sapinstance_monitor
-		exit $?;;
-
-  validate-all)	sapinstance_validate
-		exit $?;;
-
-  *)		sapinstance_methods
-		exit $OCF_ERR_UNIMPLEMENTED;;
-esac
diff --git a/rgmanager/src/resources/apache.metadata b/rgmanager/src/resources/apache.metadata
deleted file mode 100644
index 727d138..0000000
--- a/rgmanager/src/resources/apache.metadata
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="apache">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of Apache web server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an Apache web server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Define a name for use in &lt;IfDefine name&gt; directive.
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="server_root">
-            <longdesc lang="en">
-                Define an alternate initial ServerRoot
-            </longdesc>
-            <shortdesc lang="en">
-                Initial ServerRoot
-            </shortdesc>
-	    <content type="string" default="/etc/httpd"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define an alternate ServerConfigFile
-            </longdesc>
-            <shortdesc lang="en">
-                Initial ServerConfigFile
-            </shortdesc>
-            <content type="string" default="conf/httpd.conf"/>
-        </parameter>
-
-	<parameter name="httpd_options">
-	    <longdesc lang="en">
-		Other command-line options for httpd
-	    </longdesc>
-	    <shortdesc lang="en">
-		Other command-line options for httpd
-	    </shortdesc>
-	    <content type="string" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-	    <longdesc lang="en">
-		Wait X seconds for correct end of service shutdown
-	    </longdesc>
-	    <shortdesc lang="en">
-		Wait X seconds for correct end of service shutdown
-	    </shortdesc>
-	    <content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="1"/>
-	<action name="validate-all" timeout="1"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/apache.sh b/rgmanager/src/resources/apache.sh
deleted file mode 100644
index ca0325f..0000000
--- a/rgmanager/src/resources/apache.sh
+++ /dev/null
@@ -1,255 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-if [ -x /usr/sbin/httpd ]; then
-	declare APACHE_HTTPD=/usr/sbin/httpd
-elif [ -x /usr/sbin/apache2 ]; then
-	declare APACHE_HTTPD=/usr/sbin/apache2
-fi
-declare APACHE_serverConfigFile
-declare APACHE_pid_file="`generate_name_for_pid_file`"
-declare APACHE_conf_dir="`generate_name_for_conf_dir`"
-declare APACHE_genConfig="$APACHE_conf_dir/httpd.conf"
-
-declare APACHE_parseConfig=$(dirname $0)/utils/httpd-parse-config.pl
-
-apache_serverConfigFile()
-{
-	if $(echo $OCF_RESKEY_config_file | grep -q "^/"); then
-		APACHE_serverConfigFile="$OCF_RESKEY_config_file"
-	else 
-		APACHE_serverConfigFile="$OCF_RESKEY_server_root/$OCF_RESKEY_config_file"
-	fi
-
-	return;
-}
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT 
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-                                                	
-	if [ -z "$OCF_RESKEY_server_root" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid ServerRoot"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -d "$OCF_RESKEY_server_root" ]; then
-		clog_service_verify $CLOG_FAILED "ServerRoot Directory Is Missing"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$APACHE_serverConfigFile" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE "$APACHE_serverConfigFile"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$APACHE_pid_file" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid name of PID file"
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_check_syntax $CLOG_INIT "$APACHE_serverConfigFile"
-
-	"$APACHE_HTTPD" -t \
-		-D"$OCF_RESKEY_name" \
-		-d "$OCF_RESKEY_server_root" \
-		-f "$APACHE_serverConfigFile" \
-		$OCF_RESKEY_httpd_options &> /dev/null
-		
-	if [ $? -ne 0 ]; then
-		clog_check_syntax $CLOG_FAILED "$APACHE_serverConfigFile"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_check_syntax $CLOG_SUCCEED "$APACHE_serverConfigFile"
-
-	return 0
-}
-
-generate_configFile()
-{
-	declare originalConfigFile=$1;
-	declare generatedConfigFile=$2;
-	declare ip_addresses=$3;
-
-	if [ -f "$generatedConfigFile" ]; then
-		sha1_verify "$generatedConfigFile"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$originalConfigFile" "$generatedConfigFile"
-
-	generate_configTemplate "$generatedConfigFile" "$1"
-	cat >> "$generatedConfigFile" << EOT
-# From a cluster perspective, the key fields are:
-#     Listen - must be set to service floating IP address.
-#     ServerRoot - path to the ServerRoot (initial value is set in service conf)
-#
-
-EOT
-
-	IFS_old="$IFS"
-	IFS=$'\n'
-	for i in `"$APACHE_parseConfig" -D"$OCF_RESKEY_name" < "$originalConfigFile" | grep -P '(^Listen)|(^Port)' `; do 
-		port=`echo $i | sed 's/^Listen \(.*\)/\1/;s/^Port \(.*\)/\1/'`;
-		testcond=`echo $port|grep :`
-		if [ $testcond ]; then
-			port=`echo $port|awk -F : '{print $2}'`
-		fi
-		IFS=$' ';
-		for z in $ip_addresses; do 
-			echo "Listen $z:$port" >> "$generatedConfigFile";
-		done
-		IFS=$'\n';
-	done;
-	IFS="$IFS_old"
-
-	echo "PidFile \"$APACHE_pid_file\"" >> "$generatedConfigFile";
-	echo >> "$generatedConfigFile"
-
-	cat "$originalConfigFile" | sed 's/^Listen/### Listen/;s/^Port/### Port/;s/^PidFile/### PidFile/' | \
-	"$APACHE_parseConfig" -D"$OCF_RESKEY_name" >> "$generatedConfigFile"
-
-	sha1_addToFile "$generatedConfigFile"
-	clog_generate_config $CLOG_SUCCEED "$originalConfigFile" "$generatedConfigFile"
-}
-
-start()
-{
-	declare ip_addresses
-
-	clog_service_start $CLOG_INIT	
-
-	create_pid_directory
-	create_conf_directory "$APACHE_conf_dir"
-	check_pid_file "$APACHE_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$APACHE_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-	get_service_ip_keys "$OCF_RESKEY_service_name"
-	ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	generate_configFile "$APACHE_serverConfigFile" "$APACHE_genConfig" "$ip_addresses"
-
-	"$APACHE_HTTPD" \
-		"-D$OCF_RESKEY_name" \
-		-d "$OCF_RESKEY_server_root" \
-		-f "$APACHE_genConfig" \
-		$OCF_RESKEY_httpd_options \
-		-k start
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED		
-		return $OCF_ERR_GENERIC
-	else
-		clog_service_start $CLOG_SUCCEED
-	fi
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$APACHE_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$APACHE_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$APACHE_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-if [ "$1" != "meta-data" ]; then
-	apache_serverConfigFile
-fi;
-		
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all|verify-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
deleted file mode 100644
index 06214d5..0000000
--- a/rgmanager/src/resources/clusterfs.sh
+++ /dev/null
@@ -1,275 +0,0 @@
-#!/bin/bash
-
-#
-# Cluster File System mount/umount/fsck/etc. agent
-#
-
-. $(dirname $0)/utils/fs-lib.sh
-
-do_metadata()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="clusterfs" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines a cluster file system mount (i.e. GFS)
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a cluster file system mount.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Symbolic name for this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                File System Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="mountpoint" unique="1" required="1">
-	    <longdesc lang="en">
-	        Path in file system heirarchy to mount this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Mount Point
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="device" unique="1" required="1">
-	    <longdesc lang="en">
-	        Block device, file system label, or UUID of file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Device or Label
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="fstype">
-	    <longdesc lang="en">
-	        File system type.  If not specified, mount(8) will attempt to
-		determine the file system type.
-	    </longdesc>
-            <shortdesc lang="en">
-                File system type
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="force_unmount">
-            <longdesc lang="en">
-                If set, the cluster will kill all processes using 
-                this file system when the resource group is 
-                stopped.  Otherwise, the unmount will fail, and
-                the resource group will be restarted.
-            </longdesc>
-            <shortdesc lang="en">
-                Force Unmount
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="options">
-            <longdesc lang="en">
-                If set, the file system will be checked (even if
-                it is a journalled file system).  This option is
-                ignored for non-journalled file systems such as
-                ext2.
-            </longdesc>
-            <shortdesc lang="en">
-                Mount Options
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-	<parameter name="self_fence">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		immediately reboot.  Generally, this is used in conjunction
-		with force-unmount support, but it is not required.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Seppuku Unmount
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-	<parameter name="fsid">
-	    <longdesc lang="en">
-	    	File system ID for NFS exports.  This can be overridden
-		in individual nfsclient entries.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	NFS File system ID
-	    </shortdesc>
-	    <content type="string"/>
-	</parameter>
-
-	<parameter name="nfslock" inherit="service%nfslock">
-	    <longdesc lang="en">
-	        If set, the node will try to kill lockd and issue 
-		reclaims across all remaining network interface cards.
-		This happens always, regardless of unmounting failed.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="900"/>
-	<action name="stop" timeout="30"/>
-	<!-- Recovery isn't possible; we don't know if resources are using
-	     the file system. -->
-
-	<!-- Checks to see if it's mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<!-- Checks to see if we can write to the mountpoint (if !ROFS) -->
-	<action name="status" depth="20" timeout="30" interval="10m"/>
-	<action name="monitor" depth="20" timeout="30" interval="10m"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="5"/>
-    </actions>
-
-    <special tag="rgmanager">
-    	<child type="fs" start="1" stop="3"/>
-    	<child type="clusterfs" start="1" stop="3"/>
-        <child type="nfsexport" start="3" stop="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-verify_fstype()
-{
-	# Auto detect?
-	[ -z "$OCF_RESKEY_fstype" ] && return $OCF_SUCCESS
-
-	case $OCF_RESKEY_fstype in
-	gfs|gfs2)
-		return $OCF_SUCCESS
-		;;
-	*)
-		ocf_log err "File system type $OCF_RESKEY_fstype not supported"
-		return $OCF_ERR_ARGS
-		;;
-	esac
-}
-
-
-verify_options()
-{
-	declare -i ret=$OCF_SUCCESS
-
-	#
-	# From mount(8)
-	#
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-		case $o in
-		async|atime|auto|defaults|dev|exec|_netdev|noatime)
-			continue
-			;;
-		noauto|nodev|noexec|nosuid|nouser|ro|rw|suid|sync)
-			continue
-			;;
-		dirsync|user|users)
-			continue
-			;;
-		esac
-
-		case $OCF_RESKEY_fstype in
-		gfs)
-			case $o in
-				lockproto=*|locktable=*|hostdata=*)
-					continue;
-					;;
-				localcaching|localflocks|ignore_local_fs)
-					continue;
-					;;
-				num_glockd|acl|suiddir)	
-					continue
-					;;
-			esac
-			;;
-		gfs2)
-			# XXX
-			continue
-			;;
-		esac
-
-
-		ocf_log err "Option $o not supported for $OCF_RESKEY_fstype"
-		ret=$OCF_ERR_ARGS
-	done
-
-	return $ret
-}
-
-
-do_verify()
-{
-	verify_name || return $OCF_ERR_ARGS
-	verify_fstype || return $OCF_ERR_ARGS
-	verify_device || return $OCF_ERR_ARGS
-	verify_mountpoint || return $OCF_ERR_ARGS
-	verify_options || return $OCF_ERR_ARGS
-}
-
-
-do_pre_unmount() {
-	#
-	# Check the rgmanager-supplied reference count if one exists.
-	# If the reference count is <= 1, we can safely proceed
-	#
-	if [ -n "$OCF_RESKEY_RGMANAGER_meta_refcnt" ]; then
-		refs=$OCF_RESKEY_RGMANAGER_meta_refcnt
-		if [ $refs -gt 0 ]; then
-			ocf_log debug "Not unmounting $OCF_RESOURCE_INSTANCE - still in use by $refs other service(s)"
-			return 2
-		fi
-	fi
-
-	if [ -z "$force_umount" ]; then
-		ocf_log debug "Not umounting $dev (clustered file system)"
-		return 2
-	fi
-
-	#
-	# Always do this hackery on clustered file systems.
-	#
-	if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-		ocf_log warning "Dropping node-wide NFS locks"
-		mkdir -p $mp/.clumanager/statd
-		pkill -KILL -x lockd
-		# Copy out the notify list; our 
-		# IPs are already torn down
-		if notify_list_store $mp/.clumanager/statd; then
-			notify_list_broadcast $mp/.clumanager/statd
-		fi
-	fi
-
-	# Always invalidate buffers on clusterfs resources
-	clubufflush -f $dev
-
-	return 0
-}
-
-main $*
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
deleted file mode 100644
index 4eae767..0000000
--- a/rgmanager/src/resources/default_event_script.sl
+++ /dev/null
@@ -1,617 +0,0 @@
-define node_in_set(node_list, node)
-{
-	variable x, len;
-
-	len = length(node_list);
-	for (x = 0; x < len; x++) {
-		if (node_list[x] == node)
-			return 1;
-	}
-
-	return 0;
-}
-
-
-%
-% Returns 3 node lists:
-% (1) Nodes with no services
-% (2) Nodes with non-exclusive services
-% (3) Nodes with exclusive services
-%
-% NOTE: This function currently defenstrates failover domain rules
-%
-define separate_nodes(node_list)
-{
-	variable services = service_list();
-	variable nodes_empty, nodes_services, nodes_excl;
-	variable x, len;
-	variable owner, state, excl, ns = 0, nx = 0;
-
-	nodes_empty = node_list;
-
-	% Most Awesome Initializer EVER!!!
-	nodes_services = subtract([0], 0);
-	nodes_excl = subtract([0], 0);
-
-	len = length(services);
-	for (x = 0; x < len; x++) {
-
-		(,,, owner, state) = service_status(services[x]);
-		if (owner < 0) {
-			continue;
-		}
-
-		excl = atoi(service_property(services[x], "exclusive"));
-		nodes_empty = subtract(nodes_empty, owner);
-		if (excl) {
-			nodes_excl = union(nodes_excl, owner);
-		} else {
-			nodes_services = union(nodes_services, owner);
-		}
-	}
-
-	return (nodes_empty, nodes_services, nodes_excl);
-}
-
-
-define exclusive_prioritize(svc, node_list)
-{
-	variable services = service_list();
-	variable len, x, y, owner, state, preferred_owner;
-	variable svc_excl, other_excl;
-	variable nodes_x, nodes_s, nodes_e;
-
-	%
-	% Not exclusive?  Don't care!
-	%
-	svc_excl = atoi(service_property(svc, "exclusive"));
-	if (svc_excl == 0) {
-		return node_list;
-	}
-
-	(nodes_e, nodes_s, nodes_x) = separate_nodes(node_list);
-	debug("Nodes - Empty: ", nodes_e, " w/Services: ", nodes_s, " w/Excl: ", nodes_x);
-	if (length(nodes_e) > 0) {
-		%
-		% If we've got an exclusive service, only allow it to start on 
-		% empty nodes.
-		%
-		return nodes_e;
-	}
-
-	if (length(nodes_x) == 0) {
-		%
-		% If we've got NO nodes with other exclusive services
-		% and no empty nodes, the service can not be started
-		%
-		notice("No empty / exclusive nodes available; cannot restart ", svc);
-		return nodes_x;
-	}
-
-	%
-	% Prioritization of exclusive services: pancake a service and replace it
-	% with this service if this services is a higher priority.
-	%
-	len = length(services);
-	for (x = 0; x < len; x++) {
-		if (svc == services[x]) {
-			% don't do anything to ourself! 
-			continue;
-		}
-
-		(,,, owner, state) = service_status(services[x]);
-		if (owner < 0) {
-			continue;
-		}
-
-		if (node_in_set(node_list, owner) == 0) {
-			continue;
-		}
-
-		other_excl = atoi(service_property(services[x], "exclusive"));
-		if (other_excl == 0) {
-			continue;
-		}
-
-		%
-		% If we're a higher priority (lower #) exclusive
-		% Stop the exclusive service that node and move that
-		% node to the front.
-		%
-		if (svc_excl >= other_excl) {
-			continue;
-		}
-
-		%
-		% 
-		%
-		warning("STOPPING service ", services[x], " because ", svc, " is a higher priority.");
-		() = service_stop(services[x]);
-
-		%
-		% Return just the one node.
-		%
-		node_list = subtract([0], 0);
-		node_list = union(node_list, owner);
-		return node_list;
-	}
-
-	return node_list;
-}
-
-
-define move_or_start(service, node_list)
-{
-	variable len;
-	variable state, owner;
-	variable depends;
-
-	depends = service_property(service, "depend");
-	if (depends != "") {
-		(,,, owner, state) = service_status(depends);
-		if (owner < 0) {
-			debug(service, " is not runnable; dependency not met");
-			return ERR_DEPEND;
-		}
-	}
-
-	(,,, owner, state) = service_status(service);
-	debug("Evaluating ", service, " state=", state, " owner=", owner);
-	if ((event_type == EVENT_NODE) and (node_id == owner) and
-	    (node_state == NODE_OFFLINE)) {
-		info("Marking service ", service, " on down member ",
-		     owner, " as stopped");
-		if (service_stop(service) < 0) {
-			return ERR_ABORT;
-		}
-	}
-
-	len = length(node_list);
-	if (len == 0) {
-		notice(service, " is not runnable - restricted domain offline");
-		()=service_stop(service);
-		return ERR_DOMAIN;
-	}
-
-	if (((event_type != EVENT_USER) and (state == "disabled")) or
-            ((state == "failed") or (state == "frozen"))) {
-		%
-		% Commenting out this block will -not- allow you to
-		% recover failed services from event scripts.  Sorry.
-		% All it will get you is a false log message about
-		% starting this service.
-		%
-		% You may enable disabled services, but I recommend
-		% against it.
-		%
-		debug(service, " is not runnable");
-		return -1;
-	}
-
-	if (node_list[0] == owner) {
-		debug(service, " is already running on best node");
-		return ERR_RUNNING;
-	}
-
-	if ((owner >= 0) and (node_in_set(node_list, owner) == 1)) {
-		notice("Moving ", service, " from ", owner,
-		       " to ", node_list);
-		if (service_stop(service) < 0) {
-			return ERR_ABORT;
-		}
-	} else {
-		node_list = exclusive_prioritize(service, node_list);
-		notice("Starting ", service, " on ", node_list);
-	}
-
-	if (length(node_list) == 0) {
-		return ERR_DOMAIN; 
-	}
-	return service_start(service, node_list);
-}
-
-
-%
-% Returns the set of online nodes in preferred/shuffled order which
-% are allowed to run this service.  Gives highest preference to current
-% owner if nofailback is specified.
-% 
-define allowed_nodes(service)
-{
-	variable anodes;
-	variable online;
-	variable nodes_domain;
-	variable ordered, restricted, nofailback;
-	variable state, owner;
-	variable depends;
-
-	(nofailback, restricted, ordered, nodes_domain) =
-			service_domain_info(service);
-
-	(,,, owner, state) = service_status(service);
-
-	anodes = nodes_online();
-
-	% Shuffle the array so we don't start all services on the same
-	% node.  TODO - add RR, Least-services, placement policies...
-	online = shuffle(anodes);
-
-	if (restricted == 1) {
-		anodes = intersection(nodes_domain, online);
-	} else {
-		% Ordered failover domains (nodes_domain) unioned with the
-		% online nodes basically just reorders the online node list
-		% according to failover domain priority rules.
-		anodes = union(intersection(nodes_domain, online),
-			       online);
-	}
-
-	if ((nofailback == 1) or (ordered == 0)) {
-		
-		if ((owner < 0) or (node_in_set(anodes, owner) == 0)) {
-			return anodes;
-		}
-		
-		% Because union takes left as priority, we can
-		% return the union of the current owner with the
-		% allowed node list.  This means the service will
-		% remain on the same node it's currently on.
-		return union(owner, anodes);
-	}
-
-	return anodes;
-}
-
-%
-% Returns the set of online nodes in preferred/shuffled order which
-% are allowed to run this service.  Gives highest preference to current
-% owner if nofailback is specified.
-% 
-define allowed_nodes(service)
-{
-	variable anodes;
-	variable online;
-	variable nodes_domain;
-	variable ordered, restricted, nofailback;
-	variable state, owner;
-	variable depends;
-
-	(nofailback, restricted, ordered, nodes_domain) =
-			service_domain_info(service);
-	(,,, owner, state) = service_status(service);
-
-	anodes = nodes_online();
-
-	% Shuffle the array so we don't start all services on the same
-	% node.  TODO - add RR, Least-services, placement policies...
-	online = shuffle(anodes);
-
-	if (restricted == 1) {
-		anodes = intersection(nodes_domain, online);
-	} else {
-		% Ordered failover domains (nodes_domain) unioned with the
-		% online nodes basically just reorders the online node list
-		% according to failover domain priority rules.
-		anodes = union(intersection(nodes_domain, online),
-			       online);
-	}
-
-	if ((nofailback == 1) or (ordered == 0)) {
-		
-		if ((owner < 0) or (node_in_set(anodes, owner) == 0)) {
-			return anodes;
-		}
-		
-		% Because union takes left as priority, we can
-		% return the union of the current owner with the
-		% allowed node list.  This means the service will
-		% remain on the same node it's currently on.
-		return union(owner, anodes);
-	}
-
-	return anodes;
-}
-
-define string_list(thelist, delimiter)
-{
-	variable index;
-	variable output="";
-
-	if (length(thelist) == 0) {
-		return output;
-	}
-  
-	for (index=0; index < length(thelist)-1; index++) {
-		output=output+string(thelist[index])+delimiter;
-	}
-	return output+thelist[index];
-}
-
-% this function gets the smallest property from a given list of services
-% if the list only exists of one element the property itself is returned
-% if the given property is not found 0 is returned
-define services_min_attribute(services, property)
-{
-	variable x;
-	variable min_property=-1;
-	variable tmp_property;
-
-	for (x = 0; x < length(services); x++) {
-		tmp_property=service_property(services[x], property);
-		if (tmp_property == NULL) {
-			tmp_property=0;
-		} else {
-			tmp_property=atoi(tmp_property);
-		}
-		if ((min_property < 0) or (tmp_property < min_property)) {
-			min_property=tmp_property;
-		}
-		%debug("services_min_attribute: ",services[x]," attribute: ",min_property, "tmp: ", tmp_property, " min: ", min_property);
-	}
-
-	%debug("services_min_attribute: (", string_list(services, ", "),")[",property,"]: ",min_property);
-
-	return min_property;
-}
-
-% This function will sort a given service_list by the given attribute name and
-% return the list
-define sorted_service_list(services, attribute)
-{
-	variable work_queue={};
-	variable sorted_list={}, tmp, tmp2;
-	variable x, y;
-	variable cur_min_prop=0;
-	variable service_prop=0;
-
-	y=0;
-	%debug("sorted_service_list: ", strjoin(services, ", "));
-	for (x=0; x<length(services); x++) {
-		list_append(work_queue, string(services[x]));
-	}
-
-	%debug("sorted_service_list: work_queue ", string_list(work_queue, ", "));
-	while (length(work_queue) > 0) {
-		cur_min_prop=services_min_attribute(work_queue, attribute);
-		%debug("sorted_service_list sorting services list for attribute ", attribute, " cur_min: ",cur_min_prop);
-		for (x = 0; x < length(work_queue); x++) {
-			service_prop=service_property(work_queue[x], "priority");
-			if (service_prop == NULL) {
-				service_prop=0;
-			} else {
-				service_prop=atoi(service_prop);
-			}
-			%debug("sorted_service_list: ",work_queue[x], " property[", attribute,"]: ",service_prop);
-			if (cur_min_prop==service_prop) {
-				%debug("sorted_service_list: adding service ",work_queue[x]," to sorted. work_queue: ", string_list(work_queue, ", "));
-				list_append(sorted_list, work_queue[x]);
-				%debug("sorted_service_list: sorted_list: ", string_list(sorted_list, ", "));
-				%debug("sorted_service_list: removing service ",work_queue[x], " from work_queue ", string_list(work_queue, ", "));
-				list_delete(work_queue, x);
-				x=x-1;
-				%debug("sorted_service_list: work_queue: ",string_list(work_queue, ", "));
-				y=y+1;
-			}
-		}
-	}
-
-	debug("sorted_service_list ", string_list(sorted_list, ", "));
-	return sorted_list;
-}
-
-define sortedservices_node_event_handler(services, attribute) {
-	variable x;
-	variable nodes;
-
-	services=sorted_service_list(services, attribute);
-	for (x = 0; x < length(services); x++) {
-		debug("Executing sortedservices node event handler for service: ", services[x]);
-		nodes = allowed_nodes(services[x]);
-		()=move_or_start(services[x], nodes);
-	}
-}
-
-define default_node_event_handler()
-{
-	variable services = service_list();
-	variable x;
-	variable nodes;
-
-	debug("Executing default node event handler");
-	for (x = 0; x < length(services); x++) {
-		nodes = allowed_nodes(services[x]);
-		()=move_or_start(services[x], nodes);
-	}
-}
-
-
-define default_service_event_handler()
-{
-	variable services = service_list();
-	variable x;
-	variable depends;
-	variable depend_mode;
-	variable policy;
-	variable nodes;
-	variable tmp;
-	variable owner;
-	variable state;
-
-	debug("Executing default service event handler");
-
-	if (service_state == "recovering") {
-
-		policy = service_property(service_name, "recovery");
-		debug("Recovering",
-		      " Service: ", service_name,
-		      " Last owner: ", service_last_owner,
-		      " Policy: ", policy,
-		      " RTE: ", service_restarts_exceeded);
-
-		if (policy == "disable") {
-			() = service_stop(service_name, 1);
-			return;
-		}
-
-		nodes = allowed_nodes(service_name);
-		if (policy == "restart" and service_restarts_exceeded == 0) {
-			nodes = union(service_last_owner, nodes);
-		} else {
-			% relocate 
-			tmp = subtract(nodes, service_last_owner);
-			if (length(tmp) == 0) {
-				() = service_stop(service_name,0);
-				return;
-			}
-
-			nodes = union(tmp, service_last_owner);
-		}
-
-		()=move_or_start(service_name, nodes);
-
-		return;
-	}
-
-	for (x = 0; x < length(services); x++) {
-		if (service_name == services[x]) {
-			% don't do anything to ourself! 
-			continue;
-		}
-
-		%
-		% Simplistic dependency handling
-		%
-		depends = service_property(services[x], "depend");
-		depend_mode = service_property(services[x], "depend_mode");
-
-		% No dependency; do nothing
-		if (depends != service_name) {
-			continue;
-		}
-
-		(,,, owner, state) = service_status(services[x]);
-		if ((service_state == "started") and (owner < 0) and
-		    (state == "stopped")) {
-			info("Dependency met; starting ", services[x]);
-			nodes = allowed_nodes(services[x]);
-			()=move_or_start(services[x], nodes);
-		}
-
-		% service died - stop service(s) that depend on the dead
-		if ((service_owner < 0) and (owner >= 0) and
-		    (depend_mode != "soft")) {
-			info("Dependency lost; stopping ", services[x]);
-			()=service_stop(services[x]);
-		}
-	}
-}
-
-define default_config_event_handler()
-{
-	debug("Executing default config event handler");
-}
-
-define default_user_event_handler()
-{
-	variable ret;
-	variable nodes;
-	variable reordered;
-	variable x;
-	variable target = user_target;
-	variable found = 0;
-	variable owner, state;
-
-	nodes = allowed_nodes(service_name);
-	(,,, owner, state) = service_status(service_name);
-
-	if (user_request == USER_RESTART) {
-
-		if (owner >= 0) {
-			reordered = union(owner, nodes);
-			nodes = reordered;
-		}
-
-		notice("Stopping ", service_name, " for relocate to ", nodes);
-
-		found = service_stop(service_name);
-		if (found < 0) {
-			return ERR_ABORT;
-		}
-
-		ret = move_or_start(service_name, nodes);
-
-	} else if ((user_request == USER_RELOCATE) or 
-		   (user_request == USER_ENABLE)) {
-
-		if (user_target > 0) {
-			for (x = 0; x < length(nodes); x++) {
-				%
-				% Put the preferred node at the front of the 
-				% list for a user-relocate operation
-				%
-				if (nodes[x] == user_target) {
-					reordered = union(user_target, nodes);
-					nodes = reordered;
-					found = 1;
-				}
-			}
-	
-			if (found == 0) {
-				warning("User specified node ", user_target,
-					" is offline");
-			}
-		}
-
-		if ((owner >= 0) and (user_request == USER_RELOCATE)) {
-			if (service_stop(service_name) < 0) {
-				return ERR_ABORT;
-			}
-
-			%
-			% The current owner shouldn't be the default
-			% for a relocate operation
-			%
-			reordered = subtract(nodes, owner);
-			nodes = union(reordered, owner);
-		}
-
-		ret = move_or_start(service_name, nodes);
-
-	} else if (user_request == USER_DISABLE) {
-
-		ret = service_stop(service_name, 1);
-
-	} else if (user_request == USER_STOP) {
-
-		ret = service_stop(service_name);
-
-	} else if (user_request == USER_FREEZE) {
-
-		ret = service_freeze(service_name);
-
-	} else if (user_request == USER_UNFREEZE) {
-
-		ret = service_unfreeze(service_name);
-
-	} else if (user_request == USER_MIGRATE) {
-
-		ret = service_migrate(service_name, user_target);
-
-	} else if (user_request == USER_CONVALESCE) {
-
-		ret = service_convalesce(service_name);
-
-	}
-
-	return ret;
-}
-
-if (event_type == EVENT_NODE)
-	sortedservices_node_event_handler(service_list(), "priority");
-if (event_type == EVENT_SERVICE)
-	default_service_event_handler();
-if (event_type == EVENT_CONFIG)
-	default_config_event_handler();
-if (event_type == EVENT_USER)
-	user_return=default_user_event_handler();
-
diff --git a/rgmanager/src/resources/drbd.metadata b/rgmanager/src/resources/drbd.metadata
deleted file mode 100644
index 30fe122..0000000
--- a/rgmanager/src/resources/drbd.metadata
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" ?>
-<resource-agent version="rgmanager 2.0" name="drbd">
-  <version>1.0</version>
-
-  <longdesc lang="en">
-    This is a DRBD resource. The resource must be configured
-    in the configuration file (/etc/drbd.conf), and the
-    DRBD kernel module must be loaded. 
-  </longdesc>
-
-  <shortdesc lang="en">
-    This is a DRBD resource.
-  </shortdesc>
-
-  <parameters>
-    <parameter name="name" unique="1" primary="1">
-      <longdesc lang="en">
-    Symbolic name for this resource.
-      </longdesc>
-      <shortdesc lang="en">
-    Cluster resource name
-      </shortdesc>
-      <content type="string"/>
-    </parameter>
-    <parameter name="resource" unique="1" required="1">
-      <longdesc lang="en">
-	The DRBD resource name, as specified in /etc/drbd.conf.
-      </longdesc>
-      <shortdesc lang="en">
-	DRBD resource name
-      </shortdesc>
-      <content type="string"/>
-    </parameter>
-  </parameters>
-
-  <actions>
-    <action name="start" timeout="20"/>
-    <action name="stop" timeout="20"/>
-    
-    <!-- Checks to see if the resource is Primary locally -->
-    <action name="status" depth="10" interval="60" timeout="20"/>
-    <action name="monitor" depth="10" interval="60" timeout="20"/>
-    
-    <action name="meta-data" timeout="20"/>
-    <action name="verify-all" timeout="20"/>
-  </actions>
-  
-  <special tag="rgmanager">
-    <attributes maxinstances="1"/>
-  </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/drbd.sh b/rgmanager/src/resources/drbd.sh
deleted file mode 100644
index 4571660..0000000
--- a/rgmanager/src/resources/drbd.sh
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/bin/bash
-#
-#  Copyright LINBIT, 2008
-#
-#  This program is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU General Public License as published by the
-#  Free Software Foundation; either version 2, or (at your option) any
-#  later version.
-#
-#  This program is distributed in the hope that it will be useful, but
-#  WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; see the file COPYING.  If not, write to the
-#  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
-#  MA 02139, USA.
-#
-
-#
-# DRBD resource management using the drbdadm utility.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-drbd_verify_all()
-{
-    # Do we have the drbdadm utility?
-    if ! which drbdadm >/dev/null 2>&1 ; then
-	ocf_log error "drbdadm not installed, not found in PATH ($PATH), or not executable."
-	return $OCF_ERR_INSTALLED
-    fi
-
-    # Is drbd loaded?
-    if ! grep drbd /proc/modules >/dev/null 2>&1; then
-	ocf_log error "drbd not found in /proc/modules. Do you need to modprobe?"
-	return $OCF_ERR_INSTALLED
-    fi
-
-    # Do we have the "resource" parameter?
-    if [ -n "$OCF_RESKEY_resource" ]; then
-
-      # Can drbdadm parse the resource name?
-      if ! drbdadm sh-dev $OCF_RESKEY_resource >/dev/null 2>&1; then
-  	ocf_log error "DRBD resource \"$OCF_RESKEY_resource\" not found." 
-  	return $OCF_ERR_CONFIGURED
-      fi
-
-      # Is the backing device a locally available block device?
-      backing_dev=$(drbdadm sh-ll-dev $OCF_RESKEY_resource)
-      if [ ! -b $backing_dev ]; then
-  	ocf_log error "Backing device for DRBD resource \"$OCF_RESKEY_resource\" ($backing_dev) not found or not a block device."
-  	return $OCF_ERR_INSTALLED
-      fi
-
-    fi
-
-    return 0
-}
-
-drbd_status() {
-    role=$(drbdadm role $OCF_RESKEY_resource)
-    case $role in
-	Primary/*)
-	    return $OCF_RUNNING
-	    ;;
-	Secondary/*)
-	    return $OCF_NOT_RUNNING
-	    ;;
-
-    esac
-    return $OCF_ERR_GENERIC
-}
-
-drbd_promote() {
-    drbdadm primary $OCF_RESKEY_resource || return $?
-}
-
-drbd_demote() {
-    drbdadm secondary $OCF_RESKEY_resource || return $?
-}
-
-
-if [ -z "$OCF_CHECK_LEVEL" ]; then
-	OCF_CHECK_LEVEL=0
-fi
-
-# This one doesn't need to pass the verify check
-case $1 in
-    meta-data)
-	cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'` && exit 0
-	exit $OCF_ERR_GENERIC
-	;;
-esac
-
-# Everything else does
-drbd_verify_all || exit $?
-case $1 in
-    start)
-	if drbd_status; then
-	    ocf_log debug "DRBD resource ${OCF_RESKEY_resource} already configured"
-	    exit 0
-	fi
-	drbd_promote 
-	if [ $? -ne 0 ]; then
-	    exit $OCF_ERR_GENERIC
-	fi
-	
-	exit $?
-	;;
-    stop)
-	if drbd_status; then
-	    drbd_demote
-	    if [ $? -ne 0 ]; then
-		exit $OCF_ERR_GENERIC
-	    fi
-	else
-	    ocf_log debug "DRBD resource ${OCF_RESKEY_resource} is not configured"
-	fi
-	exit 0
-	;;
-    status|monitor)
-	drbd_status
-	exit $?
-	;;
-    restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	exit 0
-	;;
-    verify-all)
-    	exit 0
-    	;;
-    *)
-	echo "usage: $0 {start|stop|status|monitor|restart|meta-data|verify-all}"
-	exit $OCF_ERR_GENERIC
-	;;
-esac
diff --git a/rgmanager/src/resources/follow-service.sl b/rgmanager/src/resources/follow-service.sl
deleted file mode 100644
index 4c711ec..0000000
--- a/rgmanager/src/resources/follow-service.sl
+++ /dev/null
@@ -1,151 +0,0 @@
-% follow-service.sl
-%
-% Description:	Implements the "follow service" mechanism based on the Red Hat RIND event 
-%               scripting mechanism.
-%
-% Author:       Marc Grimme, Mark Hlawatschek, October 2008
-% Support:      support at atix.de
-% License:      GNU General Public License (GPL), version 2 or later
-% Copyright:    (c) 2008-2010 ATIX AG
-
-
-debug("*** follow-service.sl");
-
-
-%
-% Returns a list of nodes for the given service that are online and in the failoverdomain.
-%
-define nodelist_online(service_name) {
-   variable nodes, nofailback, restricted, ordered, node_list;
-   nodes=nodes_online();
-   
-   (nofailback, restricted, ordered, node_list) = service_domain_info(service_name);
-   
-   return intersection(nodes, node_list);
-}
-
-%
-% Idea: 
-%   General purpose function of a construct when Service(svc1) and Service(svc2) 
-%   should not be running on the same node even after failover.
-%   There are to options to influence the behaviour. If both services have to be 
-%   running on the same node (only one node is left in the failovergroup) what 
-%   service is the master and should both services be running or only the master
-%   service survives. If master is not svc1 or svc2 both service might run on the 
-%   same node. If master is either svc1 or svc2 the specified one will be the 
-%   surviving service.
-%   If followslave is not 0 the svc1 always follows svc2. That means it will be 
-%   started on on the same node as svc1. And if available svc2 will be relocated
-%   to any other node.
-%
-define follow_service(svc1, svc2, master) %, followslave)
-{
-	variable state_svc1, state_svc2, owner_svc1, owner_svc2;
-	variable nodes1, nodes2, allowed;
-
-	debug("*** FOLLOW_SERVICE: follow_service(",svc1,", ",svc2,", ", master, ")");
-	debug("*** FOLLOW_SERVICE: event_type: ", event_type, ", service_name: ", service_name, ", service_state: ", service_state);
-
-	%
-	% setup the master
-	%
-	if ((master != svc1) and (master != svc2)) {
-		debug("*** FOLLOW_SERVICE: master=NULL");
-		master=NULL;
-	}
-
-	% get infos we need to decide further
-	(,,, owner_svc1, state_svc1) = service_status(svc1);
-	(,,, owner_svc2, state_svc2) = service_status(svc2);
-	nodes1 = nodelist_online(svc1);
-	nodes2 = nodelist_online(svc2);
-	debug("*** FOLLOW_SERVICE: service_status(",svc1,"): ", state_svc1);
-	debug("*** FOLLOW_SERVICE: owner_svc1: ", owner_svc1, ", owner_svc2: ", owner_svc2, ", nodes1: ", nodes1, ", nodes2: ", nodes2);
-
-	if (((event_type == EVENT_NODE)    and (owner_svc1 == node_id) and (node_state == NODE_OFFLINE) and (owner_svc2 >=0)) or 
-		((event_type == EVENT_SERVICE) and (service_name == svc1)  and (service_state == "recovering" ) and (owner_svc2 >= 0))) {
-		%
-		% uh oh, the owner of the master server died.  Restart it
-		% on the node running the slave server or if we should not 
-		% follow the slave start it somewhere else.
-		% We should end up here if svc1 has to be restarted
-
-		%
-		% If this was a service event, don't execute the default event
-		% script trigger after this script completes.
-		%
-		if (event_type == EVENT_SERVICE) {
-			stop_processing();
-		}
-		% were to start svc2
-		allowed=subtract(nodes2, owner_svc2);
-		if (length(allowed) > 1) {
-			allowed=subtract(allowed, service_last_owner);
-		}
-		debug("*** FOLLOW SERVICE: service event triggered following svc2 to ",owner_svc2, " svc2 on : ",allowed);
-
-		% either svc1 is the master or there are node were to start svc2
-		if ((master == svc1) or (length(allowed) > 0)) {
-			()=service_start(svc1, owner_svc2);
-		}
-		% either svc2 is the master or there are node were to start svc2
-		if ((master == svc2) or (length(allowed) > 0)) {
-			()=service_stop(svc2);
-			()=service_start(svc2, allowed);
-		} 
-	}
-	else if (((event_type == EVENT_NODE) and (owner_svc2 == node_id) and (node_state == NODE_OFFLINE) and (owner_svc2 >=0)) or 
-		((event_type == EVENT_SERVICE) and (service_name == svc2) and (service_state == "recovering" ) and (owner_svc1 >= 0))) {
-		%
-		% uh oh, the owner of the svc2 died.  Restart it
-		% on any other node but not the one running the svc1.
-		% If svc1 is the only one left only start it there 
-		% if master==svc2
-		%
-		% Just relocate svc2 or if svc2 is master stop svc1 and start svc2 on owner_svc1
-
-		%
-		% If this was a service event, don't execute the default event
-		% script trigger after this script completes.
-		%
-	  
-		if (event_type == EVENT_SERVICE) {
-			stop_processing();
-		}
-
-		allowed=subtract(nodes2, owner_svc1);
-		if (length(allowed) > 1) {
-			allowed=subtract(allowed, service_last_owner);
-		}
-
-		debug("*** FOLLOW SERVICE: service event triggered relocating svc2 to ",allowed, " svc1 on : ",owner_svc1);
-
-		if (length(allowed) > 0) {
-			()=service_stop(svc2);
-			()=service_start(svc2, allowed);
-		} else if (master == svc2) {
-			()=service_stop(svc1);
-			()=service_start(svc2, owner_svc1);
-		}
-	}
-	else if (((event_type == EVENT_SERVICE) and (service_state == "started") and (owner_svc2 == owner_svc1) and (owner_svc1 > 0) and (owner_svc2 > 0)) or
-    		((event_type == EVENT_CONFIG) and (owner_svc2 == owner_svc1))) {
-		allowed=subtract(nodes2, owner_svc1);
-		debug("*** FOLLOW SERVICE: service event both running on same node triggered.", allowed);
-		if (length(allowed) > 0) {
-			%()=service_stop(svc1);
-			%()=service_start(svc1, owner_svc2);
-			()=service_stop(svc2);
-			()=service_start(svc2, allowed);
-		} else if ((master == svc2) and (owner_svc2 > 0)){
-			debug("*** FOLLOW SERVICE: will stop service .", svc1); 
-			()=service_stop(svc1);
-		} else if ((master == svc1) and (owner_svc1 > 0)) {
-			debug("*** FOLLOW SERVICE: will stop service .", svc2);
-			()=service_stop(svc2);
-		} else {
-			debug("*** FOLLOW SERVICE: both services running on the same node or only one is running.", allowed, ", ", master);
-		}
-	}
-	return;
-}
diff --git a/rgmanager/src/resources/fs.sh.in b/rgmanager/src/resources/fs.sh.in
deleted file mode 100644
index b63d53b..0000000
--- a/rgmanager/src/resources/fs.sh.in
+++ /dev/null
@@ -1,443 +0,0 @@
-#!/bin/bash
-
-#
-# File system (normal) mount/umount/fsck/etc. agent
-#
-
-. $(dirname $0)/utils/fs-lib.sh
-
-do_metadata()
-{
-	cat <<EOT
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<resource-agent name="fs" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines a standard file system mount (= not a clustered
-	or otherwise shared file system).
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a file system mount.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Symbolic name for this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                File System Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="mountpoint" unique="1" required="1">
-	    <longdesc lang="en">
-	        Path in file system heirarchy to mount this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Mount Point
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="device" unique="1" required="1">
-	    <longdesc lang="en">
-	        Block device, file system label, or UUID of file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Device or Label
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="fstype">
-	    <longdesc lang="en">
-	        File system type.  If not specified, mount(8) will attempt to
-		determine the file system type.
-	    </longdesc>
-            <shortdesc lang="en">
-                File system type
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="force_unmount">
-            <longdesc lang="en">
-                If set, the cluster will kill all processes using 
-                this file system when the resource group is 
-                stopped.  Otherwise, the unmount will fail, and
-                the resource group will be restarted.
-            </longdesc>
-            <shortdesc lang="en">
-                Force Unmount
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="quick_status">
-            <longdesc lang="en">
-		Use quick status checks.  When set to 0 (the default), this
-		agent behaves normally.  When set to 1, this agent will not
-		log errors incurred or perform the file system accessibility
-		check (e.g. it will not try to read from/write to the file
-		system).  You should only set this to 1 if you have lots of
-		file systems on your cluster or you are seeing very high load
-		spikes as a direct result of this agent.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Quick/brief status checks.
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-	<parameter name="self_fence">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		immediately reboot.  Generally, this is used in conjunction
-		with force-unmount support, but it is not required.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Seppuku Unmount
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-	<parameter name="nfslock" inherit="nfslock">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		try to kill lockd and issue reclaims across all remaining
-		network interface cards.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-	<parameter name="fsid">
-	    <longdesc lang="en">
-	    	File system ID for NFS exports.  This can be overridden
-		in individual nfsclient entries.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	NFS File system ID
-	    </shortdesc>
-	    <content type="string"/>
-	</parameter>
-
-        <parameter name="force_fsck">
-            <longdesc lang="en">
-                If set, the file system will be checked (even if
-                it is a journalled file system).  This option is
-                ignored for non-journalled file systems such as
-                ext2.
-            </longdesc>
-            <shortdesc lang="en">
-                Force fsck support
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="options">
-            <longdesc lang="en">
-	    	Options used when the file system is mounted.  These
-		are often file-system specific.  See mount(8) for supported
-		mount options.
-            </longdesc>
-            <shortdesc lang="en">
-                Mount Options
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="900"/>
-	<action name="stop" timeout="30"/>
-	<!-- Recovery isn't possible; we don't know if resources are using
-	     the file system. -->
-
-	<!-- Checks to see if it's mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Note: active monitoring is constant and supplants all
-	     check depths -->
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="30"/>
-	<action name="monitor" depth="10" timeout="30" interval="30"/>
-
-	<!-- Checks to see if we can write to the mountpoint (if !ROFS) -->
-	<action name="status" depth="20" timeout="30" interval="1m"/>
-	<action name="monitor" depth="20" timeout="30" interval="1m"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="5"/>
-    </actions>
-
-    <special tag="rgmanager">
-	<attributes maxinstances="1"/>
-        <child type="fs" start="1" stop="3"/>
-        <child type="clusterfs" start="1" stop="3"/>
-        <child type="nfsexport" start="3" stop="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-verify_fstype()
-{
-	# Auto detect?
-	[ -z "$OCF_RESKEY_fstype" ] && return 0
-
-	case $OCF_RESKEY_fstype in
-	ext2|ext3|ext4|btrfs|jfs|xfs|reiserfs|vfat|tmpfs|vxfs)
-		return 0
-		;;
-	*)
-		echo "File system type $OCF_RESKEY_fstype not supported"
-		return $OCF_ERR_ARGS
-		;;
-	esac
-}
-
-
-verify_options()
-{
-	declare -i ret=$OCF_SUCCESS
-	declare o
-
-	#
-	# From mount(8)
-	#
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-		case $o in
-		async|atime|auto|defaults|dev|exec|_netdev|noatime)
-			continue
-			;;
-		noauto|nodev|noexec|nosuid|nouser|ro|rw|suid|sync)
-			continue
-			;;
-		dirsync|user|users)
-			continue
-			;;
-		esac
-
-		do_verify_option $OCF_RESKEY_fstype "$o"
-
-		case $OCF_RESKEY_fstype in
-		ext2|ext3|ext4)
-			case $o in
-			bsddf|minixdf|check|check=*|nocheck|debug)
-				continue
-				;;
-			errors=*|grpid|bsdgroups|nogrpid|sysvgroups)
-				continue
-				;;
-			resgid=*|resuid=*|sb=*|grpquota|noquota)
-				continue
-				;;
-			quota|usrquota|nouid32)
-				continue
-				;;
-			esac
-
-			if [ "$OCF_RESKEY_fstype" = "ext3" ] ||
-			   [ "$OCF_RESKEY_fstype" = "ext4" ]; then
-				case $0 in
-				noload|data=*)
-					continue
-					;;
-				esac
-			fi
-			;;
-		vfat)
-			case $o in
-			blocksize=512|blocksize=1024|blocksize=2048)
-				continue
-				;;
-			uid=*|gid=*|umask=*|dmask=*|fmask=*)
-				continue
-				;;
-			check=r*|check=n*|check=s*|codepage=*)
-				continue
-				;;
-			conv=b*|conv=t*|conv=a*|cvf_format=*)
-				continue
-				;;
-			cvf_option=*|debug|fat=12|fat=16|fat=32)
-				continue
-				;;
-			iocharset=*|quiet)
-				continue
-				;;
-			esac
-			;;
-
-		jfs)
-			case $o in
-			conv|hash=rupasov|hash=tea|hash=r5|hash=detect)
-				continue
-				;;
-			hashed_relocation|no_unhashed_relocation)
-				continue
-				;;
-			noborder|nolog|notail|resize=*)
-				continue
-				;;
-			esac
-			;;
-
-		xfs)
-			case $o in
-			biosize=*|dmapi|xdsm|logbufs=*|logbsize=*)
-				continue
-				;;
-			logdev=*|rtdev=*|noalign|noatime)
-				continue
-				;;
-			norecovery|osyncisdsync|quota|userquota)
-				continue
-				;;
-			uqnoenforce|grpquota|gqnoenforce)
-				continue
-				;;
-			sunit=*|swidth=*)
-				continue
-				;;
-			esac
-			;;
-
-		tmpfs)
-			case $o in
-			size=*|nr_blocks=*|mode=*)
-				continue
-				;;
-			esac
-			;;
-		btrfs)
-			# tbd
-			continue
-			;;
-		esac
-
-		echo Option $o not supported for $OCF_RESKEY_fstype
-		ret=$OCF_ERR_ARGS
-	done
-
-	return $ret
-}
-
-
-do_validate()
-{
-	verify_name || return $OCF_ERR_ARGS
-	verify_fstype || return $OCF_ERR_ARGS
-	verify_device || return $OCF_ERR_ARGS
-	verify_mountpoint || return $OCF_ERR_ARGS
-	verify_options || return $OCF_ERR_ARGS
-}
-
-
-do_pre_mount()
-{
-	declare fstype="$OCF_RESKEY_fstype"
-
-	#
-	# Check to determine if we need to fsck the filesystem.
-	#
-	# Note: this code should not indicate in any manner suggested
-	# file systems to use in the cluster.  Known filesystems are
-	# listed here for correct operation.
-	#
-        case "$fstype" in
-        reiserfs) typeset fsck_needed="" ;;
-        ext3)     typeset fsck_needed="" ;;
-        ext4)     typeset fsck_needed="" ;;
-        btrfs)    typeset fsck_needed="" ;;
-        jfs)      typeset fsck_needed="" ;;
-        xfs)      typeset fsck_needed="" ;;
-	vxfs)	  typeset fsck_needed="" ;;
-        ext2)     typeset fsck_needed=yes ;;
-        minix)    typeset fsck_needed=yes ;;
-        vfat)     typeset fsck_needed=yes ;;
-        msdos)    typeset fsck_needed=yes ;;
-	"")       typeset fsck_needed=yes ;;		# assume fsck
-	*)
-		typeset fsck_needed=yes 		# assume fsck
-	     	ocf_log warn "\
-Unknown file system type '$fstype' for device $dev.  Assuming fsck is required."
-		;;
-	esac
-
-
-	#
-	# Fsck the device, if needed.
-	#
-	if [ -n "$fsck_needed" ] || [ "${OCF_RESKEY_force_fsck}" = "yes" ] ||\
-	   [ "${OCF_RESKEY_force_fsck}" = "1" ]; then
-		typeset fsck_log=@LOGDIR@/$(basename $dev).fsck.log
-		ocf_log debug "Running fsck on $dev"
-		fsck -p $dev >> $fsck_log 2>&1
-		ret_val=$?
-		if [ $ret_val -gt 1 ]; then
-			ocf_log err "\
-'fsck -p $dev' failed, error=$ret_val; check $fsck_log for errors"
-			ocf_log debug "Invalidating buffers for $dev"
-			$INVALIDATEBUFFERS -f $dev
-			return $OCF_ERR_GENERIC
-		fi
-		rm -f $fsck_log
-	fi
-
-	return 0
-}
-
-do_post_mount() {
-	#
-	# Create this for the NFS NLM broadcast bit
-	#
-	if [ $NFS_TRICKS -eq 0 ]; then
-		if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   	   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-			mkdir -p "$mp"/.clumanager/statd
-			notify_list_merge "$mp"/.clumanager/statd
-		fi
-	fi
-
-	return 0
-}
-
-
-do_force_unmount() {
-	if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-		ocf_log warning "Dropping node-wide NFS locks"
-		pkill -KILL -x lockd
-		mkdir -p "$mp"/.clumanager/statd
-		# Copy out the notify list; our
-		# IPs are already torn down
-		notify_list_store "$mp"/.clumanager/statd
-
-		# Save for post-umount phase
-		export nfslock_reclaim=1
-	fi
-
-	return 0
-}
-
-
-do_post_unmount() {
-	if [ "$nfslock_reclaim" = "1" ]; then
-		# If we have this flag set, do a full reclaim broadcast
-		notify_list_broadcast "$mp"/.clumanager/statd
-	fi
-
-	return 0
-}
-
-main $*
diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh
deleted file mode 100644
index 714da05..0000000
--- a/rgmanager/src/resources/ip.sh
+++ /dev/null
@@ -1,970 +0,0 @@
-#!/bin/bash
-
-#
-# IPv4/IPv6 address management using new /sbin/ifcfg instead of 
-# ifconfig utility.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-# Grab nfs lock tricks if available
-export NFS_TRICKS=1
-if [ -f "$(dirname $0)/svclib_nfslock" ]; then
-	. $(dirname $0)/svclib_nfslock
-	NFS_TRICKS=0
-fi
-
-. $(dirname $0)/ocf-shellfuncs
-
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent version="rgmanager 2.0" name="ip">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This is an IP address.  Both IPv4 and IPv6 addresses are supported,
-        as well as NIC link monitoring for each IP address.
-    </longdesc>
-    <shortdesc lang="en">
-        This is an IP address.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="address" unique="1" primary="1">
-            <longdesc lang="en">
-                IPv4 or IPv6 address to use as a virtual IP
-                resource.
-            </longdesc>
-
-            <shortdesc lang="en">
-                IP Address
-            </shortdesc>
-
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="family">
-            <longdesc lang="en">
-                IPv4 or IPv6 address protocol family.
-            </longdesc>
-
-            <shortdesc lang="en">
-                Family
-            </shortdesc>
-
-            <!--
-            <val>auto</val>
-            <val>inet</val>
-            <val>inet6</val>
-            -->
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="monitor_link">
-            <longdesc lang="en">
-                Enabling this causes the status check to fail if
-                the link on the NIC to which this IP address is
-                bound is not present.
-            </longdesc>
-            <shortdesc lang="en">
-                Monitor NIC Link
-            </shortdesc>
-            <content type="boolean" default="1"/>
-        </parameter>
-
-	<parameter name="nfslock" inherit="service%nfslock">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		try to kill lockd and issue reclaims across all remaining
-		network interface cards.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds
-	    </shortdesc>
-	    <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>
-        <action name="start" timeout="20"/>
-        <action name="stop" timeout="20"/>
-	<!-- No recover action.  If the IP address is not useable, then
-	     resources may or may not depend on it.  If it's been 
-	     deconfigured, resources using it are in a bad state. -->
-
-	<!-- Checks to see if the IP is up and (optionally) the link is
-	     working -->
-        <action name="status" interval="20" timeout="10"/>
-        <action name="monitor" interval="20" timeout="10"/>
-
-	<!-- Checks to see if we can ping the IP address locally -->
-        <action name="status" depth="10" interval="60" timeout="20"/>
-        <action name="monitor" depth="10" interval="60" timeout="20"/>
-
-        <action name="meta-data" timeout="20"/>
-        <action name="validate-all" timeout="20"/>
-    </actions>
-
-    <special tag="rgmanager">
-	<attributes maxinstances="1"/>
-	<child type="nfsclient" forbid="1"/>
-	<child type="nfsexport" forbid="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-verify_address()
-{
-	# XXX TBD
-	return 0
-}
-
-
-verify_all()
-{
-	# XXX TBD
-	return 0
-}
-
-
-#
-# Expand an IPv6 address.
-#
-ipv6_expand()
-{
-	typeset addr=$1
-	typeset maskbits
-	typeset -i x
-	typeset tempaddr
-	
-	maskbits=${addr/*\//}
-	if [ "$maskbits" = "$addr" ]; then
-		maskbits=""
-	else
-		# chop off mask bits
-		addr=${addr/\/*/}
-	fi
-
-	# grab each hex quad and expand it to 4 digits if it isn't already
-	# leave doublecolon in place for expansion out to the proper number of zeros later
-	tempaddr=""
-	for count in `seq 1 8`; do
-		quad=`echo $addr|awk -v count=$count -F : '{print $count}'`
-		quadlen=${#quad}
-		if [ $quadlen -eq 0 ]; then
-			quad=::
-		elif [ $quadlen -eq 1 ]; then
-			quad=000$quad
-		elif [ $quadlen -eq 2 ]; then
-			quad=00$quad
-		elif [ $quadlen -eq 3 ]; then
-			quad=0$quad
-		fi
-		tempaddr=$tempaddr$quad
-	done
-	addr=$tempaddr
-
-	# use space as placeholder
-	addr=${addr/::/\ }
-
-	# get rid of colons
-	addr=${addr//:/}
-
-	# add in zeroes where the doublecolon was
-	len=$((${#addr}-1))
-	zeroes=
-	while [ $len -lt 32 ]; do
-		zeroes="0$zeroes"
-		((len++))
-	done
-	addr=${addr/\ /$zeroes}
-
-	# probably a better way to do this
-	for (( x=0; x < ${#addr} ; x++)); do
-		naddr=$naddr${addr:x:1}
-
-		if (( x < (${#addr} - 1) && x%4 == 3)); then
-			naddr=$naddr:
-		fi
-	done
-
-	if [ -n "$maskbits" ]; then
-		echo "$naddr/$maskbits"
-		return 0
-	fi
-
-	echo "$naddr"
-	return 0
-}
-
-
-#
-# see if two ipv6 addrs are in the same subnet
-#
-ipv6_same_subnet()
-{
-	declare addrl=$1
-	declare addrr=$2
-	declare m=$3 
-	declare r x llsb rlsb
-
-	if [ $# -lt 2 ]; then
-		ocf_log err "usage: ipv6_same_subnet addr1 addr2 [mask]"
-		return 255
-	fi
-
-	if [ -z "$m" ]; then
-		m=${addrl/*\//}
-
-		[ -n "$m" ] || return 1
-
-	fi
-
-	if [ "${addrr}" != "${addrr/*\//}" ] &&
-	   [ "$m" != "${addrr/*\//}" ]; then
-		return 1
-	fi
-
-	addrl=${addrl/\/*/}
-	if [ ${#addrl} -lt 39 ]; then
-		addrl=$(ipv6_expand $addrl)
-	fi
-
-	addrr=${addrr/\/*/}
-	if [ ${#addrr} -lt 39 ]; then
-		addrr=$(ipv6_expand $addrr)
-	fi
-
-	# Calculate the amount to compare directly
-	x=$(($m/4+$m/16-(($m%4)==0)))
-
-	# and the remaining number of bits
-	r=$(($m%4))
-
-	if [ $r -ne 0 ]; then
-		# If we have any remaining bits, we will need to compare
-		# them later.  Get them now.
-		llsb=`printf "%d" 0x${addrl:$x:1}`
-		rlsb=`printf "%d" 0x${addrr:$x:1}`
-
-		# One less byte to compare directly, please
-		((--x))
-	fi
-	
-	# direct (string comparison) to see if they are equal
-	if [ "${addrl:0:$x}" != "${addrr:0:$x}" ]; then
-		return 1
-	fi
-
-	case $r in
-	0)
-		return 0
-		;;
-	1)	
-		[ $(($llsb & 8)) -eq $(($rlsb & 8)) ]
-		return $?
-		;;
-	2)
-		[ $(($llsb & 12)) -eq $(($rlsb & 12)) ]
-		return $?
-		;;
-	3)
-		[ $(($llsb & 14)) -eq $(($rlsb & 14)) ]
-		return $?
-		;;
-	esac
-
-	return 1
-}
-
-
-ipv4_same_subnet()
-{
-	declare addrl=$1
-	declare addrr=$2
-	declare m=$3 
-	declare r x llsb rlsb
-
-	if [ $# -lt 2 ]; then
-		ocf_log err "usage: ipv4_same_subnet current_addr new_addr [maskbits]"
-		return 255
-	fi
-
-
-	#
-	# Chop the netmask off of the ipaddr:
-	# e.g. 1.2.3.4/22 -> 22
-	#
-	if [ -z "$m" ]; then
-		m=${addrl/*\//}
-		[ -n "$m" ] || return 1
-	fi
-
-	#
-	# Check to see if there was a subnet mask provided on the
-	# new IP address.  If there was one and it does not match
-	# our expected subnet mask, we are done.
-	#
-	if [ "${addrr}" != "${addrr/\/*/}" ] &&
-	   [ "$m" != "${addrr/*\//}" ]; then
-		return 1
-	fi
-
-	#
-	# Chop off subnet bits for good.
-	#
-	addrl=${addrl/\/*/}
-	addrr=${addrr/\/*/}
-
-	#
-	# Remove '.' characters from dotted decimal notation and save
-	# in arrays. i.e.
-	#
-	#	192.168.1.163 -> array[0] = 192
-	#	                 array[1] = 168
-	#	                 array[2] = 1
-	#	                 array[3] = 163
-	#
-
-	let x=0
-	for quad in ${addrl//./\ }; do
-		ip1[((x++))]=$quad
-	done
-
-	x=0
-	for quad in ${addrr//./\ }; do
-		ip2[((x++))]=$quad
-	done
-
-	x=0
-
-	while [ $m -ge 8 ]; do
-		((m-=8))
-		if [ ${ip1[x]} -ne ${ip2[x]} ]; then
-			return 1
-		fi
-		((x++))
-	done
-
-	case $m in
-	0)
-		return 0
-		;;
-	1)	
-		[ $((${ip1[x]} & 128)) -eq $((${ip2[x]} & 128)) ]
-		return $?
-		;;
-	2)
-		[ $((${ip1[x]} & 192)) -eq $((${ip2[x]} & 192)) ]
-		return $?
-		;;
-	3)
-		[ $((${ip1[x]} & 224)) -eq $((${ip2[x]} & 224)) ]
-		return $?
-		;;
-	4)
-		[ $((${ip1[x]} & 240)) -eq $((${ip2[x]} & 240)) ]
-		return $?
-		;;
-	5)
-		[ $((${ip1[x]} & 248)) -eq $((${ip2[x]} & 248)) ]
-		return $?
-		;;
-	6)
-		[ $((${ip1[x]} & 252)) -eq $((${ip2[x]} & 252)) ]
-		return $?
-		;;
-	7)
-		[ $((${ip1[x]} & 254)) -eq $((${ip2[x]} & 254)) ]
-		return $?
-		;;
-	esac
-
-	return 1
-}
-
-
-ipv6_list_interfaces()
-{
-	declare idx dev ifaddr
-	declare ifaddr_exp
-	
-	while read idx dev ifaddr; do
-	    
-		isSlave $dev
-		if [ $? -ne 2 ]; then
-			continue
-		fi
-		
-		idx=${idx/:/}
-		
-		ifaddr_exp=$(ipv6_expand $ifaddr)
-		
-		echo $dev ${ifaddr_exp/\/*/} ${ifaddr_exp/*\//}
-		
-	done < <(/sbin/ip -o -f inet6 addr | awk '{print $1,$2,$4}')
-
-	return 0
-}
-
-
-isSlave()
-{
-	declare intf=$1
-	declare line
-
-	if [ -z "$intf" ]; then
-		ocf_log err "usage: isSlave <I/F>"
-		return $OCF_ERR_ARGS
-	fi
-
-	line=$(/sbin/ip link list dev $intf)
-	if [ $? -ne 0 ]; then
-		ocf_log err "$intf not found"
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ "$line" = "${line/<*SLAVE*>/}" ]; then
-		return 2
-	fi
-
-	# Yes, it is a slave device.  Ignore.
-	return 0
-}
-
-
-# 
-# Check if interface is in UP state
-#
-interface_up()
-{
-       declare intf=$1
-       
-       if [ -z "$intf" ]; then
-		ocf_log err "usage: interface_up <I/F>"
-		return 1
-       fi
-       
-       line=$(/sbin/ip -o link show up dev $intf 2> /dev/null)
-       [ -z "$line" ] && return 2
-       
-       return 0
-}
-
-
-ethernet_link_up()
-{
-	declare linkstate=$(ethtool $1 | grep "Link detected:" |\
-			    awk '{print $3}')
-	
-	[ -n "$linkstate" ] || return 0
-
-	case $linkstate in
-	yes)
-		return 0
-		;;
-	*)
-		return 1
-		;;
-	esac
-	
-	return 1
-}
-
-
-#
-# Checks the physical link status of an ethernet or bonded interface.
-#
-network_link_up()
-{
-	declare slaves
-	declare intf_arg=$1
-	declare link_up=1		# Assume link down
-	declare intf_test
-
-	if [ -z "$intf_arg" ]; then
-		ocf_log err "usage: network_link_up <intf>"
-		return 1
-	fi
-	
-	ethernet_link_up $intf_arg
-	link_up=$?
-
-	if [ $link_up -eq 0 ]; then
-		ocf_log debug "Link for $intf_arg: Detected"
-	else
-		ocf_log warn "Link for $intf_arg: Not detected"
-	fi
-
-	return $link_up
-}
-
-
-ipv4_list_interfaces()
-{
-	declare idx dev ifaddr
-
-	while read idx dev ifaddr; do
-	        
-		isSlave $dev
-		if [ $? -ne 2 ]; then
-			continue
-		fi
-		
-		idx=${idx/:/}
-		
-		echo $dev ${ifaddr/\/*/} ${ifaddr/*\//}
-		
-	done < <(/sbin/ip -o -f inet addr | awk '{print $1,$2,$4}')
-	
-	return 0
-}
-
-
-#
-# Add an IP address to our interface.
-#
-ipv6()
-{
-	declare dev maskbits
-	declare addr=$2
-	declare addr_exp=$(ipv6_expand $addr)
-	
-	while read dev ifaddr_exp maskbits; do 
-	        if [ -z "$dev" ]; then
-		        continue
-		fi
-		
-		if [ "$1" = "add" ]; then
-			ipv6_same_subnet $ifaddr_exp/$maskbits $addr_exp
-			if [ $? -ne 0 ]; then
-                                continue
-                        fi
-                        interface_up $dev
-                        if [ $? -ne 0 ]; then
-                                continue
-                        fi
-			if [ "$OCF_RESKEY_monitor_link" = "yes" ]; then
-                        	network_link_up $dev
-                        	if [ $? -ne 0 ]; then
-                                	continue
-                        	fi
-			fi
-
-			if [ "${addr/\/*/}" = "${addr}" ]; then
-				addr="$addr/$maskbits"
-			fi
-			ocf_log info "Adding IPv6 address $addr to $dev"
-		fi
-		if [ "$1" = "del" ]; then
-		        if [ "${addr_exp/\/*/}" != "$ifaddr_exp" ]; then
-			        continue
-			fi
-			addr=`/sbin/ip addr list | grep "$addr" | head -n 1 | awk '{print $2}'`
-			ocf_log info "Removing IPv6 address $addr from $dev"
-                fi
-		
-		if [ "$1" = "add" ]; then
-			ocf_log debug "Pinging addr ${addr%%/*} from dev $dev"
-			if ping_check inet6 ${addr%%/*} $dev; then
-				ocf_log err "IPv6 address collision ${addr%%/*}"
-				return 1
-			fi
-		fi
-		/sbin/ip -f inet6 addr $1 dev $dev $addr
-		[ $? -ne 0 ] && return 1
-		
-		#
-		# NDP should take of figuring out our new address.  Plus,
-		# we do not have something (like arping) to do this for ipv6
-		# anyway.
-		# 
-		# RFC 2461, section 7.2.6 states thusly:
-		#
-	   	# Note that because unsolicited Neighbor Advertisements do not
-		# reliably update caches in all nodes (the advertisements might
-		# not be received by all nodes), they should only be viewed as
-		# a performance optimization to quickly update the caches in
-		#  most neighbors. 
-		#
-		
-		# Not sure if this is necessary for ipv6 either.
-		file=$(which rdisc 2>/dev/null)
-		if [ -f "$file" ]; then
-		        killall -HUP rdisc || rdisc -fs
-		fi
-		
-		return 0
-	done < <(ipv6_list_interfaces)
-	
-	return 1
-}
-
-
-#
-# Add an IP address to our interface.
-#
-ipv4()
-{
-	declare dev ifaddr maskbits
-	declare addr=$2
-	
-	while read dev ifaddr maskbits; do
-	        if [ -z "$dev" ]; then
-		        continue
-		fi
-
-		if [ "$1" = "add" ]; then
-		        ipv4_same_subnet $ifaddr/$maskbits $addr
-			if [ $? -ne 0 ]; then
-			        continue
-			fi
-		        interface_up $dev
-			if [ $? -ne 0 ]; then
-			        continue
-			fi
-			if [ "$OCF_RESKEY_monitor_link" = "yes" ]; then
-				network_link_up $dev
-				if [ $? -ne 0 ]; then
-					continue
-				fi
-			fi
-
-			if [ "${addr/\/*/}" = "${addr}" ]; then
-				addr="$addr/$maskbits"
-			fi
-			ocf_log info "Adding IPv4 address $addr to $dev"
-		fi
-		if [ "$1" = "del" ]; then
-			if [ "${addr/\/*/}" != "$ifaddr" ]; then
-			        continue
-			fi
-			addr=`/sbin/ip addr list | grep "$ifaddr/" | head -n 1 | awk '{print $2}'`
-			ocf_log info "Removing IPv4 address $addr from $dev"
-		fi
-		
-		if [ "$1" = "add" ]; then
-			ocf_log debug "Pinging addr ${addr%%/*} from dev $dev"
-			if ping_check inet ${addr%%/*} $dev; then
-				ocf_log err "IPv4 address collision ${addr%%/*}"
-				return 1
-			fi
-		fi
-		/sbin/ip -f inet addr $1 dev $dev $addr
-		[ $? -ne 0 ] && return 1
-		
-        	#
-	        # The following is needed only with ifconfig; ifcfg does it for us
-        	#
-		if [ "$1" = "add" ]; then
-        		# do that freak arp thing
-		    
- 		        hwaddr=$(/sbin/ip -o link show $dev)
-			hwaddr=${hwaddr/*link\/ether\ /}
-			hwaddr=${hwaddr/\ \*/}
-			
-			addr=${addr/\/*/}
-			ocf_log debug "Sending gratuitous ARP: $addr $hwaddr"
-			arping -q -c 2 -U -I $dev $addr
-		fi
-		
-		file=$(which rdisc 2>/dev/null)
-		if [ -f "$file" ]; then
-		        killall -HUP rdisc || rdisc -fs
-		fi
-		
-		return 0
-	done  < <(ipv4_list_interfaces)
-	
-	return 1
-}
-
-
-#
-# Usage:
-# ping_check <family> <address> [interface]
-#
-ping_check()
-{
-	declare ops="-c 1 -w 2"
-	declare pingcmd=""
-
-	if [ "$1" = "inet6" ]; then
-		pingcmd="ping6"
-	else
-		pingcmd="ping"
-	fi
-
-	if [ -n "$3" ]; then 
-		ops="$ops -I $3"
-	fi
-
-	return $($pingcmd $ops $2 &> /dev/null)
-}
-
-
-# 
-# Usage:
-# check_interface_up <family> <address>
-#
-check_interface_up()
-{
-	declare dev
-	declare addr=${2/\/*/}
-	declare currentAddr caExpanded
-
-	if [ "$1" == "inet6" ]; then
-		addrExpanded=$(ipv6_expand $addr)
-		for currentAddr in `/sbin/ip -f $1 -o addr|awk '{print $4}'`; do
-			caExpanded=$(ipv6_expand $currentAddr)
-			caExpanded=${caExpanded/\/*/}
-			if [ "$addrExpanded" == "$caExpanded" ]; then
-				dev=$(/sbin/ip -f $1 -o addr | grep " ${currentAddr/\/*/}" | awk '{print $2}')
-				break
-			fi
-		done
-	else
-		dev=$(/sbin/ip -f $1 -o addr | grep " $addr/" | awk '{print $2}')
-	fi
-
-	if [ -z "$dev" ]; then
-		return 1
-	fi
-	
-	interface_up $dev
-	return $?
-}
-
-
-# 
-# Usage:
-# address_configured <family> <address>
-#
-address_configured()
-{
-	declare line
-	declare addr
-	declare currentAddr caExpanded
-
-	# Chop off maxk bits 
-	addr=${2/\/*/}
-
-	if [ "$1" == "inet6" ]; then
-		addrExpanded=$(ipv6_expand $addr)
-		for currentAddr in `/sbin/ip -f $1 -o addr|awk '{print $4}'`; do
-			caExpanded=$(ipv6_expand $currentAddr)
-			caExpanded=${caExpanded/\/*/}
-			if [ "$addrExpanded" == "$caExpanded" ]; then
-				line=$(/sbin/ip -f $1 -o addr | grep " ${currentAddr/\/*/}");
-				break
-			fi
-		done
-	else
-		line=$(/sbin/ip -f $1 -o addr | grep " $addr/")
-	fi
-
-	if [ -z "$line" ]; then
-		return 1
-	fi
-	return 0
-}
-
-
-#
-# Usage:
-# ip_op <family> <operation> <address> [quiet]
-#
-ip_op()
-{
-	declare dev
-	declare rtr
-	declare addr=${3/\/*/}
-	declare caExpanded currentAddr
-
-	if [ "$2" = "status" ]; then
-
-		ocf_log debug "Checking $3, Level $OCF_CHECK_LEVEL"
-	
-		if [ "$1" == "inet6" ]; then
-			addrExpanded=$(ipv6_expand $addr)
-			for currentAddr in `/sbin/ip -f $1 -o addr|awk '{print $4}'`; do
-				caExpanded=$(ipv6_expand $currentAddr)
-				caExpanded=${caExpanded/\/*/}
-				if [ "$addrExpanded" == "$caExpanded" ]; then
-					dev=$(/sbin/ip -f $1 -o addr | grep " ${currentAddr/\/*/}" | awk '{print $2}')
-					break
-				fi
-			done
-		else
-			dev=$(/sbin/ip -f $1 -o addr | grep " $addr/" | awk '{print $2}')
-		fi
-
-		if [ -z "$dev" ]; then
-			ocf_log warn "$3 is not configured"
-			return 1
-		fi
-		ocf_log debug "$3 present on $dev"
-		
-		if [ "$OCF_RESKEY_monitor_link" = "yes" ]; then
-			if ! network_link_up $dev; then
-		        	ocf_log warn "No link on $dev..."
-				return 1
-			fi
-			ocf_log debug "Link detected on $dev"
-		fi
-		
-		[ $OCF_CHECK_LEVEL -lt 10 ] && return 0
-		if ! ping_check $1 $addr $dev; then
-			ocf_log warn "Failed to ping $addr"
-			return 1
-		fi
-		ocf_log debug "Local ping to $addr succeeded"
-		
-		return 0
-	fi
-
-	case $1 in
-	inet)
-		ipv4 $2 $3
-		return $?
-		;;
-	inet6)
-		if [ "$2" = "del" ]; then
-			addrExpanded=$(ipv6_expand $addr)
-			for currentAddr in `/sbin/ip -f $1 -o addr|awk '{print $4}'`; do
-				caExpanded=$(ipv6_expand $currentAddr)
-				caExpanded=${caExpanded/\/*/}
-				if [ "$addrExpanded" == "$caExpanded" ]; then
-					addr6=$(/sbin/ip -f $1 -o addr | grep " ${currentAddr/\/*/}" | awk '{print $4}')
-					ipv6 $2 $addr6
-					return $?
-				fi
-			done
-		fi
-
-		ipv6 $2 $3
-		return $?
-		;;
-	esac
-	return 1
-}
-
-
-case ${OCF_RESKEY_family} in
-inet)
-	;;
-inet6)
-	;;
-*)
-	if [ "${OCF_RESKEY_address//:/}" != "${OCF_RESKEY_address}" ]; then
-		export OCF_RESKEY_family=inet6
-	else
-		export OCF_RESKEY_family=inet
-	fi
-	;;
-esac
-
-
-if [ -z "$OCF_CHECK_LEVEL" ]; then
-	OCF_CHECK_LEVEL=0
-fi
-
-if [ "${OCF_RESKEY_monitor_link}" = "no" ] ||
-   [ "${OCF_RESKEY_monitor_link}" = "0" ]; then
-        OCF_RESKEY_monitor_link="no"
-else
-        OCF_RESKEY_monitor_link="yes"
-fi
-
-case $1 in
-start)
-	if address_configured ${OCF_RESKEY_family} ${OCF_RESKEY_address}; then
-		ocf_log debug "${OCF_RESKEY_address} already configured"
-		exit 0
-	fi
-	ip_op ${OCF_RESKEY_family} add ${OCF_RESKEY_address}
-	if [ $? -ne 0 ]; then
-		exit $OCF_ERR_GENERIC
-	fi
-
-	if [ $NFS_TRICKS -eq 0 ]; then
-		if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   	   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-			notify_list_broadcast /var/lib/nfs/statd
-		fi
-	fi
-
-	exit $?
-	;;
-stop)
-	if address_configured ${OCF_RESKEY_family} ${OCF_RESKEY_address}; then
-		
-		ip_op ${OCF_RESKEY_family} del ${OCF_RESKEY_address}
-
-		# Make sure it's down
-		if address_configured ${OCF_RESKEY_family} ${OCF_RESKEY_address}; then
-			ocf_log err "Failed to remove ${OCF_RESKEY_address}"
-			exit 1
-		fi
-
-		# XXX Let nfsd/lockd clear their queues; we hope to have a
-		# way to enforce this in the future
-		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
-	exit 0
-	;;
-status|monitor)
-	ip_op ${OCF_RESKEY_family} status ${OCF_RESKEY_address}
-	[ $? -ne 0 ] && exit $OCF_NOT_RUNNING
-	
-	check_interface_up ${OCF_RESKEY_family} ${OCF_RESKEY_address}
-	exit $?
-	;;
-restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	exit 0
-	;;
-meta-data)
-	meta_data
-	exit 0
-	;;
-validate-all|verify_all)
-	verify_all
-	exit $?
-	;;
-*)
-	echo "usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-	exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-
diff --git a/rgmanager/src/resources/lvm.metadata b/rgmanager/src/resources/lvm.metadata
deleted file mode 100644
index 3759063..0000000
--- a/rgmanager/src/resources/lvm.metadata
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" ?>
-<resource-agent name="lvm" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-	This defines a LVM volume group that is ...
-    </longdesc>
-
-    <shortdesc lang="en">
-	LVM Failover script
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-            <longdesc lang="en">
-                Unique name for this LVM resource
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="vg_name" required="1">
-            <longdesc lang="en">
-                Name of the volume group being managed
-            </longdesc>
-            <shortdesc lang="en">
-                Volume group name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="lv_name">
-            <longdesc lang="en">
-                Name of the logical volume being managed.  This
-		parameter is optional if there are more than one
-		logical volumes in the volume group to be managed.
-            </longdesc>
-            <shortdesc lang="en">
-                Logical Volume name (optional).
-            </shortdesc>
-	    <content type="string"/>
-	</parameter>
-
-	<parameter name="self_fence">
-	    <longdesc lang="en">
-		If set and the clean up of the tags fails, the node will
-		immediately reboot.
-	    </longdesc>
-	    <shortdesc lang="en">
-		Fence the node if it is not able to clean up LVM tags
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-	<parameter name="nfslock" inherit="service%nfslock">
-	    <longdesc lang="en">
-	        If set and unmounting the file system fails, the node will
-		try to kill lockd and issue reclaims across all remaining
-		network interface cards.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds
-	    </shortdesc>
-	    <content type="boolean"/>
-	</parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="5"/>
-	<action name="stop" timeout="5"/>
-
-	<action name="status" timeout="5" interval="1h"/>
-	<action name="monitor" timeout="5" interval="1h"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="30"/>
-    </actions>
-
-    <special tag="rgmanager">
-    	<attributes maxinstances="1"/>
-    </special>
-
-</resource-agent>
diff --git a/rgmanager/src/resources/lvm.sh b/rgmanager/src/resources/lvm.sh
deleted file mode 100644
index e71460c..0000000
--- a/rgmanager/src/resources/lvm.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/bash
-
-#
-# LVM Failover Script.
-# NOTE: Changes to /etc/lvm/lvm.conf are required for proper operation.
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/member_util.sh
-. $(dirname $0)/lvm_by_lv.sh
-. $(dirname $0)/lvm_by_vg.sh
-
-rv=0
-
-################################################################################
-# ha_lvm_proper_setup_check
-#
-################################################################################
-function ha_lvm_proper_setup_check
-{
-	##
-	# The default for lvm.conf:activation/volume_list is empty,
-	# this must be changed for HA LVM.
-	##
-	if ! lvm dumpconfig activation/volume_list >& /dev/null; then
-		ocf_log err "HA LVM:  Improper setup detected"
-		ocf_log err "* \"volume_list\" not specified in lvm.conf."
-		return $OCF_ERR_GENERIC
-	fi
-
-	##
-	# Machine's cluster node name must be present as
-	# a tag in lvm.conf:activation/volume_list
-	##
-	if ! lvm dumpconfig activation/volume_list | grep $(local_node_name); then
-		ocf_log err "HA LVM:  Improper setup detected"
-		ocf_log err "* @$(local_node_name) missing from \"volume_list\" in lvm.conf"
-		return $OCF_ERR_GENERIC
-	fi
-
-	##
-	# The volume group to be failed over must NOT be in
-	# lvm.conf:activation/volume_list; otherwise, machines
-	# will be able to activate the VG regardless of the tags
-	##
-	if lvm dumpconfig activation/volume_list | grep "\"$OCF_RESKEY_vg_name\""; then
-		ocf_log err "HA LVM:  Improper setup detected"
-		ocf_log err "* $OCF_RESKEY_vg_name found in \"volume_list\" in lvm.conf"
-		return $OCF_ERR_GENERIC
-	fi
-
-	##
-	# Next, we need to ensure that their initrd has been updated
-	# If not, the machine could boot and activate the VG outside
-	# the control of rgmanager
-	##
-	# Fixme: we might be able to perform a better check...
-	if [ "$(find /boot -name *.img -newer /etc/lvm/lvm.conf)" == "" ]; then
-		ocf_log err "HA LVM:  Improper setup detected"
-		ocf_log err "* initrd image needs to be newer than lvm.conf"
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-################################################################################
-# MAIN
-################################################################################
-
-case $1 in
-start)
-	if ! [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		ha_lvm_proper_setup_check || exit 1
-	fi
-
-	if [ -z $OCF_RESKEY_lv_name ]; then
-		vg_start || exit 1
-	else
-		lv_start || exit 1
-	fi
-	;;
-
-status|monitor)
-	ocf_log notice "Getting status"
-
-	if [ -z $OCF_RESKEY_lv_name ]; then
-		vg_status || exit 1
-	else
-		lv_status || exit 1
-	fi
-	;;
-		    
-stop)
-	if ! [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		if ! ha_lvm_proper_setup_check; then
-			ocf_log err "WARNING: An improper setup can cause data corruption!"
-		fi
-	fi
-
-	if [ -z $OCF_RESKEY_lv_name ]; then
-		vg_stop || exit 1
-	else
-		lv_stop || exit 1
-	fi
-	;;
-
-recover|restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	;;
-
-meta-data)
-	cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-	;;
-
-validate-all|verify-all)
-	if [ -z $OCF_RESKEY_lv_name ]; then
-		vg_verify || exit 1
-	else
-		lv_verify || exit 1
-	fi
-	;;
-*)
-	echo "usage: $0 {start|status|monitor|stop|restart|meta-data|validate-all}"
-	exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-exit $rv
diff --git a/rgmanager/src/resources/lvm_by_lv.sh b/rgmanager/src/resources/lvm_by_lv.sh
deleted file mode 100644
index 759062a..0000000
--- a/rgmanager/src/resources/lvm_by_lv.sh
+++ /dev/null
@@ -1,415 +0,0 @@
-#!/bin/bash
-
-# lv_verify
-#
-# Verify the parameters passed in
-#
-lv_verify()
-{
-	# Anything to verify?  Perhaps the names?
-	return $OCF_SUCCESS
-}
-
-# lv_exec_resilient
-#
-# Sometimes, devices can come back.  Their metadata will conflict
-# with the good devices that remain.  This function filters out those
-# failed devices when executing the given command
-#
-# Finishing with vgscan resets the cache/filter
-lv_exec_resilient()
-{
-	declare command=$1
-	declare all_pvs
-
-	ocf_log notice "Making resilient : $command"
-
-	if [ -z $command ]; then
-		ocf_log err "lv_exec_resilient: Arguments not supplied"
-		return $OCF_ERR_ARGS
-	fi
-
-	# pvs will print out only those devices that are valid
-	# If a device dies and comes back, it will not appear
-	# in pvs output (but you will get a Warning).
-	all_pvs=(`pvs --noheadings -o pv_name | grep -v Warning`)
-
-	# Now we use those valid devices in a filter which we set up.
-	# The device will then be activated because there are no
-	# metadata conflicts.
-        command=$command" --config devices{filter=["
-	for i in ${all_pvs[*]}; do
-		command=$command'"a|'$i'|",'
-	done
-	command=$command"\"r|.*|\"]}"
-
-	ocf_log notice "Resilient command: $command"
-	if ! $command ; then
-		ocf_log err "lv_exec_resilient failed"
-		vgscan
-		return $OCF_ERR_GENERIC
-	else
-		vgscan
-		return $OCF_SUCCESS
-	fi
-}
-
-# lv_activate_resilient
-#
-# Sometimes, devices can come back.  Their metadata will conflict
-# with the good devices that remain.  We must filter out those
-# failed devices when trying to reactivate
-lv_activate_resilient()
-{
-	declare action=$1
-	declare lv_path=$2
-	declare op="-ay"
-
-	if [ -z $action ] || [ -z $lv_path ]; then
-		ocf_log err "lv_activate_resilient: Arguments not supplied"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ $action != "start" ]; then
-	        op="-an"
-	fi
-
-	if ! lv_exec_resilient "lvchange $op $lv_path" ; then
-		ocf_log err "lv_activate_resilient $action failed on $lv_path"
-		return $OCF_ERR_GENERIC
-	else
-		return $OCF_SUCCESS
-	fi
-}
-
-lv_status_clustered()
-{
-	#
-	# Check if device is active
-	#
-	if [[ ! $(lvs -o attr --noheadings $lv_path) =~ ....a. ]]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-# lv_status
-#
-# Is the LV active?
-lv_status_single()
-{
-	declare lv_path="$OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-	declare dev="/dev/$lv_path"
-	declare realdev
-	declare owner
-	declare my_name
-
-	#
-	# Check if device is active
-	#
-	if [[ ! $(lvs -o attr --noheadings $lv_path) =~ ....a. ]]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		ocf_log notice "$OCF_RESKEY_vg_name is a cluster volume.  Ignoring..."
-		return $OCF_SUCCESS
-	fi
-
-	#
-	# Check if all links/device nodes are present
-	#
-        if [ -h "$dev" ]; then
-		realdev=$(readlink -f $dev)
-		if [ $? -ne 0 ]; then
-			ocf_log err "Failed to follow link, $dev"
-			return $OCF_ERR_ARGS
-		fi
-
-		if [ ! -b $realdev ]; then
-			ocf_log err "Device node for $lv_path is not present"
-			return $OCF_ERR_GENERIC
-		fi
-	else
-	        ocf_log err "Symbolic link for $lv_path is not present"
-		return $OCF_ERR_GENERIC
-	fi
-
-	#
-	# Verify that we are the correct owner
-	#
-	owner=`lvs -o tags --noheadings $lv_path`
-	my_name=$(local_node_name)
-	if [ -z $my_name ]; then
-		ocf_log err "Unable to determine local machine name"
-
-		# FIXME: I don't really want to fail on 1st offense
-		return $OCF_SUCCESS
-	fi
-
-	if [ -z $owner ] || [ $my_name != $owner ]; then
-		ocf_log err "WARNING: $lv_path should not be active"
-		ocf_log err "WARNING: $my_name does not own $lv_path"
-		ocf_log err "WARNING: Attempting shutdown of $lv_path"
-
-		lv_activate_resilient "stop" $lv_path
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-function lv_status
-{
-	# We pass in the VG name to see of the logical volume is clustered
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		lv_status_clustered
-	else
-		lv_status_single
-	fi
-}
-
-# lv_activate_and_tag
-lv_activate_and_tag()
-{
-	declare action=$1
-	declare tag=$2
-	declare lv_path=$3
-	typeset self_fence=""
-
-	case ${OCF_RESKEY_self_fence} in
-		"yes")          self_fence=1 ;;
-		1)              self_fence=1 ;;
-		*)              self_fence="" ;;
-	esac
-
-	if [ -z $action ] || [ -z $tag ] || [ -z $lv_path ]; then
-		ocf_log err "Supplied args: 1) $action, 2) $tag, 3) $lv_path"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ $action == "start" ]; then
-		ocf_log notice "Activating $lv_path"
-		lvchange --addtag $tag $lv_path
-		if [ $? -ne 0 ]; then
-			ocf_log err "Unable to add tag to $lv_path"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if ! lv_activate_resilient $action $lv_path; then
-			ocf_log err "Unable to activate $lv_path"
-			return $OCF_ERR_GENERIC
-		fi
-	else
-		ocf_log notice "Deactivating $lv_path"
-		if ! lv_activate_resilient $action $lv_path; then
-			if [ "$self_fence" ]; then
-				ocf_log err "Unable to deactivate $lv_path: REBOOTING"
-				sync
-				reboot -fn
-			else
-				ocf_log err "Unable to deactivate $lv_path"
-			fi
-			return $OCF_ERR_GENERIC
-		fi
-
-		ocf_log notice "Removing ownership tag ($tag) from $lv_path"
-
-		lvchange --deltag $tag $lv_path
-		if [ $? -ne 0 ]; then
-			ocf_log err "Unable to delete tag from $lv_path"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if [ `lvs --noheadings -o lv_tags $lv_path` == $tag ]; then
-			ocf_log notice "Removing ownership tag ($tag) from $lv_path"
-			lvchange --deltag $tag $lv_path
-			if [ $? -ne 0 ]; then
-				ocf_log err "Unable to delete tag from $lv_path"
-				return $OCF_ERR_GENERIC
-			fi
-		fi
-	fi
-
-	return $OCF_SUCCESS
-}
-
-# lv_activate
-# $1: start/stop only
-#
-# Basically, if we want to [de]activate an LVM volume,
-# we must own it.  That means that our tag must be on it.
-# This requires a change to /etc/lvm/lvm.conf:
-#	volume_list = [ "root_volume", "@my_hostname" ]
-# where "root_volume" is your root volume group and
-# "my_hostname" is $(local_node_name)
-#
-# If there is a node failure, we may wish to "steal" the
-# LV.  For that, we need to check if the node that owns
-# it is still part of the cluster.  We use the tag to
-# determine who owns the volume then query for their
-# liveness.  If they are dead, we can steal.
-lv_activate()
-{
-	declare lv_path="$OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-	declare owner=`lvs -o tags --noheadings $lv_path`
-	declare my_name=$(local_node_name)
-
-	if [ -z $my_name ]; then
-		ocf_log err "Unable to determine cluster node name"
-		return $OCF_ERR_GENERIC
-	fi
-
-	#
-	# FIXME: This code block is repeated below... might be
-	# nice to put it in a function
-	#
-	if [ ! -z $owner ] && [ $owner != $my_name ]; then
-		if is_node_member_clustat $owner ; then
-			ocf_log err "$owner owns $lv_path unable to $1"
-			return $OCF_ERR_GENERIC
-		fi
-		ocf_log notice "Owner of $lv_path is not in the cluster"
-		ocf_log notice "Stealing $lv_path"
-
-		lvchange --deltag $owner $lv_path
-		if [ $? -ne 0 ]; then
-			ocf_log err "Failed to steal $lv_path from $owner"
-			return $OCF_ERR_GENERIC
-		fi
-
-		# Warning --deltag doesn't always result in failure
-		if [ ! -z `lvs -o tags --noheadings $lv_path` ]; then
-			ocf_log err "Failed to steal $lv_path from $owner."
-			return $OCF_ERR_GENERIC
-		fi
-	fi
-
-	if ! lv_activate_and_tag $1 $my_name $lv_path; then
-		ocf_log err "Failed to $1 $lv_path"
-
-		if [ "$1" == "start" ]; then
-			ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name"
-
-			if vgreduce --removemissing --config \
-			    "activation { volume_list = \"$OCF_RESKEY_vg_name\" }" \
-			    $OCF_RESKEY_vg_name; then
-				ocf_log notice "$OCF_RESKEY_vg_name now consistent"
-				owner=`lvs -o tags --noheadings $lv_path`
-				if [ ! -z $owner ] && [ $owner != $my_name ]; then
-					if is_node_member_clustat $owner ; then
-						ocf_log err "$owner owns $lv_path unable to $1"
-						return $OCF_ERR_GENERIC
-					fi
-					ocf_log notice "Owner of $lv_path is not in the cluster"
-					ocf_log notice "Stealing $lv_path"
-
-					lvchange --deltag $owner $lv_path
-					if [ $? -ne 0 ]; then
-						ocf_log err "Failed to steal $lv_path from $owner"
-						return $OCF_ERR_GENERIC
-					fi
-
-					# Warning --deltag doesn't always result in failure
-					if [ ! -z `lvs -o tags --noheadings $lv_path` ]; then
-						ocf_log err "Failed to steal $lv_path from $owner."
-						return $OCF_ERR_GENERIC
-					fi
-				fi
-
-				if ! lv_activate_and_tag $1 $my_name $lv_path; then
-					ocf_log err "Failed second attempt to $1 $lv_path"
-					return $OCF_ERR_GENERIC
-				else
-					ocf_log notice "Second attempt to $1 $lv_path successful"
-					return $OCF_SUCCESS
-				fi
-			else
-				ocf_log err "Failed to make $OCF_RESKEY_vg_name consistent"
-				return $OCF_ERR_GENERIC
-			fi
-		else
-			ocf_log err "Failed to $1 $lv_path"
-			return $OCF_ERR_GENERIC
-		fi
-	fi
-	return $OCF_SUCCESS
-}
-
-function lv_start_clustered
-{
-	if ! lvchange -aey $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name; then
-		ocf_log err "Failed to activate logical volume, $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-		ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-
-		if ! lvconvert --repair --use-policies $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name; then
-			ocf_log err "Failed to cleanup $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if ! lvchange -aey $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name; then
-			ocf_log err "Failed second attempt to activate $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		ocf_log notice "Second attempt to activate $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name successful"
-		return $OCF_SUCCESS
-	fi
-	return $OCF_SUCCESS
-}
-
-function lv_start_single
-{
-	if ! lvs $OCF_RESKEY_vg_name >& /dev/null; then
-		lv_count=0
-	else
-		lv_count=`lvs --noheadings -o name $OCF_RESKEY_vg_name | grep -v _mlog | grep -v _mimage | grep -v nconsistent | wc -l`
-	fi
-	if [ $lv_count -gt 1 ]; then
-		ocf_log err "HA LVM requires Only one logical volume per volume group."
-		ocf_log err "There are currently $lv_count logical volumes in $OCF_RESKEY_vg_name"
-		ocf_log err "Failing HA LVM start of $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
-		exit $OCF_ERR_GENERIC
-	fi
-
-	if ! lv_activate start; then
-		return 1
-	fi
-
-	return 0
-}
-
-function lv_start
-{
-	# We pass in the VG name to see of the logical volume is clustered
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		lv_start_clustered
-	else
-		lv_start_single
-	fi
-}
-
-function lv_stop_clustered
-{
-	lvchange -aln $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name
-}
-
-function lv_stop_single
-{
-	if ! lv_activate stop; then
-		return 1
-	fi
-
-	return 0
-}
-
-function lv_stop
-{
-	# We pass in the VG name to see of the logical volume is clustered
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		lv_stop_clustered
-	else
-		lv_stop_single
-	fi
-}
diff --git a/rgmanager/src/resources/lvm_by_vg.sh b/rgmanager/src/resources/lvm_by_vg.sh
deleted file mode 100644
index f0ca671..0000000
--- a/rgmanager/src/resources/lvm_by_vg.sh
+++ /dev/null
@@ -1,401 +0,0 @@
-#!/bin/bash
-
-# vg_owner
-#
-# Returns:
-#    1 == We are the owner
-#    2 == We can claim it
-#    0 == Owned by someone else
-function vg_owner
-{
-	local owner=`vgs -o tags --noheadings $OCF_RESKEY_vg_name`
-	local my_name=$(local_node_name)
-
-	if [ -z $my_name ]; then
-		ocf_log err "Unable to determine cluster node name"
-		return 0
-	fi
-
-	if [ -z $owner ]; then
-		# No-one owns this VG yet, so we can claim it
-		return 2
-	fi
-
-	if [ $owner != $my_name ]; then
-		if is_node_member_clustat $owner ; then
-			return 0
-		fi
-		return 2
-	fi
-
-	return 1
-}
-
-function strip_tags
-{
-	local i
-
-	for i in `vgs --noheadings -o tags $OCF_RESKEY_vg_name | sed s/","/" "/g`; do
-		ocf_log info "Stripping tag, $i"
-		vgchange --deltag $i $OCF_RESKEY_vg_name
-	done
-
-	if [ ! -z `vgs -o tags --noheadings $OCF_RESKEY_vg_name` ]; then
-		ocf_log err "Failed to remove ownership tags from $OCF_RESKEY_vg_name"
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-function strip_and_add_tag
-{
-	if ! strip_tags; then
-		ocf_log err "Failed to remove tags from volume group, $OCF_RESKEY_vg_name"
-		return $OCF_ERR_GENERIC
-	fi
-
-	vgchange --addtag $(local_node_name) $OCF_RESKEY_vg_name
-	if [ $? -ne 0 ]; then
-		ocf_log err "Failed to add ownership tag to $OCF_RESKEY_vg_name"
-		return $OCF_ERR_GENERIC
-        fi
-
-	ocf_log info "New tag \"$(local_node_name)\" added to $OCF_RESKEY_vg_name"
-
-	return $OCF_SUCCESS
-}
-
-function vg_status_clustered
-{
-	return $OCF_SUCCESS
-}
-
-# vg_status
-#
-# Are all the LVs active?
-function vg_status_single
-{
-	local i
-	local dev
-	local my_name=$(local_node_name)
-
-	#
-	# Check that all LVs are active
-	#
-	for i in `lvs $OCF_RESKEY_vg_name --noheadings -o attr`; do
-		if [[ ! $i =~ ....a. ]]; then
-			return $OCF_ERR_GENERIC
-		fi
-	done
-
-	#
-	# Check if all links/device nodes are present
-	#
-	for i in `lvs $OCF_RESKEY_vg_name --noheadings -o name`; do
-		dev="/dev/$OCF_RESKEY_vg_name/$i"
-
-		if [ -h $dev ]; then
-			realdev=$(readlink -f $dev)
-			if [ $? -ne 0 ]; then
-				ocf_log err "Failed to follow link, $dev"
-				return $OCF_ERR_GENERIC
-			fi
-
-			if [ ! -b $realdev ]; then
-				ocf_log err "Device node for $dev is not present"
-				return $OCF_ERR_GENERIC
-			fi
-		else
-			ocf_log err "Symbolic link for $lv_path is not present"
-			return $OCF_ERR_GENERIC
-		fi
-	done
-
-	#
-	# Verify that we are the correct owner
-	#
-	vg_owner
-	if [ $? -ne 1 ]; then
-		ocf_log err "WARNING: $OCF_RESKEY_vg_name should not be active"
-		ocf_log err "WARNING: $my_name does not own $OCF_RESKEY_vg_name"
-		ocf_log err "WARNING: Attempting shutdown of $OCF_RESKEY_vg_name"
-
-		# FIXME: may need more force to shut this down
-		vgchange -an $OCF_RESKEY_vg_name
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-##
-# Main status function for volume groups
-##
-function vg_status
-{
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		vg_status_clustered
-	else
-		vg_status_single
-	fi
-}
-
-function vg_verify
-{
-	# Anything to verify?
-	return $OCF_SUCCESS
-}
-
-function vg_start_clustered
-{
-	local a
-	local results
-	local all_pvs
-	local resilience
-
-	ocf_log info "Starting volume group, $OCF_RESKEY_vg_name"
-
-	if ! vgchange -aey $OCF_RESKEY_vg_name; then
-		ocf_log err "Failed to activate volume group, $OCF_RESKEY_vg_name"
-		ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name"
-
-		if ! vgreduce --removemissing $OCF_RESKEY_vg_name; then
-			ocf_log err "Failed to make $OCF_RESKEY_vg_name consistent"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if ! vgchange -aey $OCF_RESKEY_vg_name; then
-			ocf_log err "Failed second attempt to activate $OCF_RESKEY_vg_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		ocf_log notice "Second attempt to activate $OCF_RESKEY_vg_name successful"
-		return $OCF_SUCCESS
-	else
-		# The activation commands succeeded, but did they do anything?
-		# Make sure all the logical volumes are active
-		results=(`lvs -o name,attr --noheadings 2> /dev/null $OCF_RESKEY_vg_name`)
-		a=0
-		while [ ! -z ${results[$a]} ]; do
-			if [[ ! ${results[$(($a + 1))]} =~ ....a. ]]; then
-				all_pvs=(`pvs --noheadings -o name 2> /dev/null`)
-				resilience=" --config devices{filter=["
-			        for i in ${all_pvs[*]}; do
-			                resilience=$resilience'"a|'$i'|",'
-        			done
-				resilience=$resilience"\"r|.*|\"]}"
-
-				vgchange -aey $OCF_RESKEY_vg_name $resilience
-				break
-			fi
-			a=$(($a + 2))
-		done
-
-		#  We need to check the LVs again if we made the command resilient
-		if [ ! -z $resilience ]; then
-			results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name $resilience 2> /dev/null`)
-			a=0
-			while [ ! -z ${results[$a]} ]; do
-				if [[ ! ${results[$(($a + 1))]} =~ ....a. ]]; then
-		                        ocf_log err "Failed to activate $OCF_RESKEY_vg_name"
-                		        return $OCF_ERR_GENERIC
-                		fi
-				a=$(($a + 2))
-			done
-			ocf_log err "Orphan storage device in $OCF_RESKEY_vg_name slowing operations"
-		fi
-	fi
-
-	return $OCF_SUCCESS
-}
-
-function vg_start_single
-{
-	local a
-	local results
-	local all_pvs
-	local resilience
-
-	ocf_log info "Starting volume group, $OCF_RESKEY_vg_name"
-
-	vg_owner
-	case $? in
-	0)
-		ocf_log info "Someone else owns this volume group"
-		return $OCF_ERR_GENERIC
-		;;
-	1)
-		ocf_log info "I own this volume group"
-		;;
-	2)
-		ocf_log info "I can claim this volume group"
-		;;
-	esac
-
-	if ! strip_and_add_tag ||
-	   ! vgchange -ay $OCF_RESKEY_vg_name; then
-		ocf_log err "Failed to activate volume group, $OCF_RESKEY_vg_name"
-		ocf_log notice "Attempting cleanup of $OCF_RESKEY_vg_name"
-
-		if ! vgreduce --removemissing --config \
-			"activation { volume_list = \"$OCF_RESKEY_vg_name\" }" \
-			$OCF_RESKEY_vg_name; then
-
-			ocf_log err "Failed to make $OCF_RESKEY_vg_name consistent"
-			return $OCF_ERR_GENERIC
-		fi
-
-		vg_owner
-		if [ $? -eq 0 ]; then
-			ocf_log err "Unable to claim ownership of $OCF_RESKEY_vg_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		if ! strip_and_add_tag ||
-		   ! vgchange -ay $OCF_RESKEY_vg_name; then
-			ocf_log err "Failed second attempt to activate $OCF_RESKEY_vg_name"
-			return $OCF_ERR_GENERIC
-		fi
-
-		ocf_log notice "Second attempt to activate $OCF_RESKEY_vg_name successful"
-		return $OCF_SUCCESS
-	else
-		# The activation commands succeeded, but did they do anything?
-		# Make sure all the logical volumes are active
-		results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name 2> /dev/null`)
-		a=0
-		while [ ! -z ${results[$a]} ]; do
-			if [[ ! ${results[$(($a + 1))]} =~ ....a. ]]; then
-				all_pvs=(`pvs --noheadings -o name 2> /dev/null`)
-				resilience=" --config devices{filter=["
-			        for i in ${all_pvs[*]}; do
-			                resilience=$resilience'"a|'$i'|",'
-        			done
-				resilience=$resilience"\"r|.*|\"]}"
-
-				vgchange -ay $OCF_RESKEY_vg_name $resilience
-				break
-			fi
-			a=$(($a + 2))
-		done
-
-		#  We need to check the LVs again if we made the command resilient
-		if [ ! -z $resilience ]; then
-			results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name $resilience 2> /dev/null`)
-			a=0
-			while [ ! -z ${results[$a]} ]; do
-				if [[ ! ${results[$(($a + 1))]} =~ ....a. ]]; then
-		                        ocf_log err "Failed to activate $OCF_RESKEY_vg_name"
-                		        return $OCF_ERR_GENERIC
-                		fi
-				a=$(($a + 2))
-			done
-			ocf_log err "Orphan storage device in $OCF_RESKEY_vg_name slowing operations"
-		fi
-	fi
-
-	return $OCF_SUCCESS
-}
-
-##
-# Main start function for volume groups
-##
-function vg_start
-{
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		vg_start_clustered
-	else
-		vg_start_single
-	fi
-}
-
-function vg_stop_clustered
-{
-	local a
-	local results
-	typeset self_fence=""
-
-	case ${OCF_RESKEY_self_fence} in
-		"yes")          self_fence=1 ;;
-		1)              self_fence=1 ;;
-		*)              self_fence="" ;;
-	esac
-
-	#  Shut down the volume group
-	#  Do we need to make this resilient?
-	vgchange -aln $OCF_RESKEY_vg_name
-
-	#  Make sure all the logical volumes are inactive
-	results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name 2> /dev/null`)
-	a=0
-	while [ ! -z ${results[$a]} ]; do
-		if [[ ${results[$(($a + 1))]} =~ ....a. ]]; then
-			if [ "$self_fence" ]; then
-				ocf_log err "Unable to deactivate $lv_path REBOOT"
-				sync
-				reboot -fn
-			else
-				ocf_log err "Logical volume $OCF_RESKEY_vg_name/${results[$a]} failed to shutdown"
-			fi
-			return $OCF_ERR_GENERIC
-		fi
-		a=$(($a + 2))
-	done
-
-	return $OCF_SUCCESS
-}
-
-function vg_stop_single
-{
-	local a
-	local results
-	typeset self_fence=""
-
-	case ${OCF_RESKEY_self_fence} in
-		"yes")          self_fence=1 ;;
-		1)              self_fence=1 ;;
-		*)              self_fence="" ;;
-	esac
-
-	#  Shut down the volume group
-	#  Do we need to make this resilient?
-	vgchange -an $OCF_RESKEY_vg_name
-
-	#  Make sure all the logical volumes are inactive
-	results=(`lvs -o name,attr --noheadings $OCF_RESKEY_vg_name 2> /dev/null`)
-	a=0
-	while [ ! -z ${results[$a]} ]; do
-		if [[ ${results[$(($a + 1))]} =~ ....a. ]]; then
-			if [ "$self_fence" ]; then
-				ocf_log err "Unable to deactivate $lv_path REBOOT"
-				sync
-				reboot -fn
-			else
-				ocf_log err "Logical volume $OCF_RESKEY_vg_name/${results[$a]} failed to shutdown"
-			fi
-			return $OCF_ERR_GENERIC
-		fi
-		a=$(($a + 2))
-	done
-
-	#  Make sure we are the owner before we strip the tags
-	vg_owner
-	if [ $? -ne 0 ]; then
-		strip_tags
-	fi
-
-	return $OCF_SUCCESS
-}
-
-##
-# Main stop function for volume groups
-##
-function vg_stop
-{
-	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
-		vg_stop_clustered
-	else
-		vg_stop_single
-	fi
-}
diff --git a/rgmanager/src/resources/mysql.metadata b/rgmanager/src/resources/mysql.metadata
deleted file mode 100644
index 7c87a57..0000000
--- a/rgmanager/src/resources/mysql.metadata
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="mysql">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of MySQL database server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a MySQL database server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Define a name 
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Define configuration file
-            </shortdesc>
-	    <content type="string" default="/etc/my.cnf"/>
-        </parameter>
-
-        <parameter name="listen_address">
-            <longdesc lang="en">
-		Define an IP address for MySQL
-            </longdesc>
-            <shortdesc lang="en">
-		Define an IP address for MySQL server. If the address
-		is not given then first IP address from the service is taken.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-	<parameter name="mysqld_options">
-		<longdesc lang="en">
-			Other command-line options for mysqld
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for mysqld
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="startup_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service startup
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service startup
-		</shortdesc>
-		<content type="number" default="30" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/mysql.sh b/rgmanager/src/resources/mysql.sh
deleted file mode 100644
index 8b244ec..0000000
--- a/rgmanager/src/resources/mysql.sh
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare MYSQL_MYSQLD=/usr/bin/mysqld_safe
-declare MYSQL_ipAddress
-declare MYSQL_pid_file="`generate_name_for_pid_file`"
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$MYSQL_pid_file" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid name of PID file"
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-	return 0
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	check_pid_file "$MYSQL_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$MYSQL_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ -n "$OCF_RESKEY_listen_address" ]; then
-		MYSQL_ipAddress="$OCF_RESKEY_listen_address"
-	else
-		clog_looking_for $CLOG_INIT "IP Address"
-
-	        get_service_ip_keys "$OCF_RESKEY_service_name"
-	        ip_addresses=`build_ip_list`
-
-		if [ -n "$ip_addresses" ]; then
-			for i in $ip_addresses; do
-				MYSQL_ipAddress="$i"
-				break;
-			done
-		else
-			clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Address"
-		fi
-	fi
-
-	clog_looking_for $CLOG_SUCCEED "IP Address"
-
-	$MYSQL_MYSQLD --defaults-file="$OCF_RESKEY_config_file" \
-		--pid-file="$MYSQL_pid_file" \
-		--bind-address="$MYSQL_ipAddress" \
-		$OCF_RESKEY_mysqld_options > /dev/null 2>&1 &
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	declare i=$OCF_RESKEY_startup_wait
-	while [ "$i" -gt 0 ]; do
-		if [ -f "$MYSQL_pid_file" ]; then
-			break;			
-		fi
-		sleep 1
-		let i=$i-1
-        done
-
-        if [ "$i" -eq 0 ]; then
-		clog_service_start $CLOG_FAILED_TIMEOUT
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$MYSQL_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$MYSQL_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$MYSQL_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/named.metadata b/rgmanager/src/resources/named.metadata
deleted file mode 100644
index 64442b1..0000000
--- a/rgmanager/src/resources/named.metadata
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="named">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of DNS named server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an instance of named server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/named.conf"/>
-        </parameter>
-
-        <parameter name="named_sdb">
-            <longdesc lang="en">
-		Simplified Database Backend
-            </longdesc>
-            <shortdesc lang="en">
-		Simplified Database Backend
-            </shortdesc>
-	    <content type="boolean" default="0"/>
-        </parameter>
-
-	<parameter name="named_working_dir">
-		<longdesc lang="en">
-			Other command-line options for named
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for named
-		</shortdesc>
-		<content type="string" default="/var/named" />
-	</parameter>
-
-	<parameter name="named_options">
-		<longdesc lang="en">
-			Other command-line options for named
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for named
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" default="5" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/named.sh b/rgmanager/src/resources/named.sh
deleted file mode 100644
index c8f65bb..0000000
--- a/rgmanager/src/resources/named.sh
+++ /dev/null
@@ -1,193 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare NAMED_NAMED=/usr/sbin/named
-declare NAMED_pid_file="`generate_name_for_pid_file`"
-declare NAMED_conf_dir="`generate_name_for_conf_dir`"
-declare NAMED_gen_config_file="$NAMED_conf_dir/named.conf"
-declare NAMED_url_list
-declare NAMED_parse_config=$(dirname $0)/utils/named-parse-config.pl
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_address="$3"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	generate_configTemplate "$generated_file" "$1"
-	cat "$original_file" | grep -v "^[[:space:]]*listen-on" | \
-		grep -v "^[[:space:]]*pid-file" | \
-		grep -v "^[[:space:]]*directory" >> "$generated_file"
-
-	declare tmp_file=`mktemp -t cluster.XXXXXXXXXX`
-	mv "$generated_file" "$tmp_file"
-
-	"$NAMED_parse_config" "$OCF_RESKEY_named_working_dir" "$NAMED_pid_file" "$ip_address" \
-		 < "$tmp_file" > "$generated_file"
-
-	rm "$tmp_file"	
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-
-	return 0;
-}
-
-start()
-{
-	declare ip_list;
-	
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$NAMED_conf_dir"
-	check_pid_file "$NAMED_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$NAMED_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	ip_list=`echo $ip_addresses | sed 's/ /;/;s/\([[:digit:]]\)$/\1;/' `
-
-	if [ -z "$ip_list" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-
-	generate_config_file "$OCF_RESKEY_config_file" "$NAMED_gen_config_file" "$ip_list"
-
-	$NAMED_NAMED -c "$NAMED_gen_config_file" $OCF_RESKEY_named_options
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$NAMED_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$NAMED_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$NAMED_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/netfs.sh b/rgmanager/src/resources/netfs.sh
deleted file mode 100644
index 53eab98..0000000
--- a/rgmanager/src/resources/netfs.sh
+++ /dev/null
@@ -1,376 +0,0 @@
-#!/bin/bash
-
-#
-# NFS/CIFS file system mount/umount/etc. agent
-#
-
-. $(dirname $0)/utils/fs-lib.sh
-
-do_metadata()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="netfs" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an NFS/CIFS mount for use by cluster services.
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an NFS/CIFS file system mount.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Symbolic name for this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                File System Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="mountpoint" unique="1" required="1">
-	    <longdesc lang="en">
-	        Path in file system heirarchy to mount this file system.
-	    </longdesc>
-            <shortdesc lang="en">
-                Mount Point
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="host" required="1">
-	    <longdesc lang="en">
-	    	Server IP address or hostname
-	    </longdesc>
-            <shortdesc lang="en">
-	    	IP or Host
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="export" required="1">
-	    <longdesc lang="en">
-	    	NFS Export directory name or CIFS share
-	    </longdesc>
-            <shortdesc lang="en">
-	    	Export
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="fstype" required="0">
-	    <longdesc lang="en">
-	    	File System type (nfs, nfs4 or cifs)
-	    </longdesc>
-            <shortdesc lang="en">
-	    	File System Type
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="no_unmount" required="0">
-	    <longdesc lang="en">
-	    	Do not unmount the filesystem during a stop or relocation operation
-	    </longdesc>
-            <shortdesc lang="en">
-	    	Skip unmount opration
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="force_unmount">
-            <longdesc lang="en">
-                If set, the cluster will kill all processes using 
-                this file system when the resource group is 
-                stopped.  Otherwise, the unmount will fail, and
-                the resource group will be restarted.
-            </longdesc>
-            <shortdesc lang="en">
-                Force Unmount
-            </shortdesc>
-	    <content type="boolean"/>
-        </parameter>
-
-        <parameter name="options">
-            <longdesc lang="en">
-	    	Provides a list of mount options.  If none are specified,
-		the NFS file system is mounted -o sync.
-            </longdesc>
-            <shortdesc lang="en">
-                Mount Options
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="900"/>
-	<action name="stop" timeout="30"/>
-	<!-- Recovery isn't possible; we don't know if resources are using
-	     the file system. -->
-
-	<!-- Checks to see if it's mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<!-- Checks to see if we can write to the mountpoint (if !ROFS) -->
-	<action name="status" depth="20" timeout="30" interval="10m"/>
-	<action name="monitor" depth="20" timeout="30" interval="10m"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="5"/>
-    </actions>
-
-    <special tag="rgmanager">
-        <child type="nfsexport" forbid="1"/>
-        <child type="nfsclient" forbid="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-verify_host()
-{
-	if [ -z "$OCF_RESKEY_host" ]; then
-	       ocf_log err "No server hostname or IP address specified."
-	       return 1
-	fi
-
-	host $OCF_RESKEY_host 2>&1 | grep -vq "not found"
-	if [ $? -eq 0 ]; then
-		return 0
-	fi
-
-	ocf_log err "Hostname or IP address \"$OCF_RESKEY_host\" not valid"
-
-	return $OCF_ERR_ARGS
-}
-
-
-verify_fstype()
-{
-	# Auto detect?
-	[ -z "$OCF_RESKEY_fstype" ] && return 0
-
-	case $OCF_RESKEY_fstype in
-	nfs|nfs4|cifs)
-		return 0
-		;;
-	*)
-		ocf_log err "File system type $OCF_RESKEY_fstype not supported"
-		return $OCF_ERR_ARGS
-		;;
-	esac
-}
-
-
-verify_options()
-{
-	declare -i ret=0
-
-	#
-	# From mount(1)
-	#
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-		case $o in
-		async|atime|auto|defaults|dev|exec|_netdev|noatime)
-			continue
-			;;
-		noauto|nodev|noexec|nosuid|nouser|ro|rw|suid|sync)
-			continue
-			;;
-		dirsync|user|users)
-			continue
-			;;
-		esac
-
-		case $OCF_RESKEY_fstype in
-		cifs)
-			continue
-			;;
-		nfs|nfs4)
-			case $o in
-			#
-			# NFS / NFS4 common
-			#
-			rsize=*|wsize=*|timeo=*|retrans=*|acregmin=*)
-				continue
-				;;
-			acregmax=*|acdirmin=*|acdirmax=*|actimeo=*)
-				continue
-				;;
-			retry=*|port=*|bg|fg|soft|hard|intr|cto|ac|noac)
-				continue
-				;;
-			esac
-
-			#
-			# NFS v2/v3 only
-			#
-			if [ "$OCF_RESKEY_fstype" = "nfs" ]; then
-				case $o in
-				mountport=*|mounthost=*)
-					continue
-					;;
-				mountprog=*|mountvers=*|nfsprog=*|nfsvers=*)
-					continue
-					;;
-				namelen=*)
-					continue
-					;;
-				tcp|udp|lock|nolock)
-					continue
-					;;
-				esac
-			fi
-
-			#
-			# NFS4 only
-			#
-			if [ "$OCF_RESKEY_fstype" = "nfs4" ]; then
-				case $o in
-				proto=*|clientaddr=*|sec=*)
-					continue
-					;;
-				esac
-			fi
-
-			;;
-		esac
-
-		ocf_log err "Option $o not supported for $OCF_RESKEY_fstype"
-		ret=$OCF_ERR_ARGS
-	done
-
-	return $ret
-}
-
-
-do_validate()
-{
-	verify_name || return $OCF_ERR_ARGS
-	verify_fstype|| return $OCF_ERR_ARGS
-	verify_host || return $OCF_ERR_ARGS
-	verify_mountpoint || return $OCF_ERR_ARGS
-	verify_options || return $OCF_ERR_ARGS
-	# verify_target || return $OCF_ERR_ARGS
-}
-
-
-#
-# Override real_device to use fs-lib's functions for start/stop_filesystem
-#
-real_device() {
-	export REAL_DEVICE="$1"
-}
-
-
-#
-# do_mount - nfs / cifs are mounted differently than blockdevs
-#
-do_mount() {
-	declare opts=""
-	declare mount_options=""
-	declare ret_val
-	declare mp="$OCF_RESKEY_mountpoint"
-
-	#
-	# Get the filesystem type, if specified.
-	#
-	fstype_option=""
-	fstype=${OCF_RESKEY_fstype}
-		case "$fstype" in
-	""|"[ 	]*")
-		fstype=""
-		;;
-	*)	# found it
-		fstype_option="-t $fstype"
-		;;
-	esac
-
-	#
-	# Get the mount options, if they exist.
-	#
-	mount_options=""
-	opts=${OCF_RESKEY_options}
-	case "$opts" in 
-	""|"[ 	]*")
-		opts=""
-		;;
-	*)	# found it
-		mount_options="-o $opts"
-		;;
-	esac
-
-        case $OCF_RESKEY_fstype in
-	nfs|nfs4)
-		mount -t $OCF_RESKEY_fstype $mount_options $OCF_RESKEY_host:"$OCF_RESKEY_export" "$mp"
-		;;
-	cifs)
-		mount -t $OCF_RESKEY_fstype $mount_options //$OCF_RESKEY_host/"$OCF_RESKEY_export" "$mp"
-		;;
-	esac
-
-	ret_val=$?
-	if [ $ret_val -ne 0 ]; then
-		ocf_log err "\
-'mount $fstype_option $mount_options $OCF_RESKEY_host:$OCF_RESKEY_export $mp' failed, error=$ret_val"
-		return 1
-	fi
-	
-	return 0
-}
-
-
-do_force_unmount() {
-        case $OCF_RESKEY_fstype in
-	nfs|nfs4)
-		ocf_log warning "Calling 'umount -f $mp'"
-		umount -f "$OCF_RESKEY_mountpoint"
-		;;
-	*)
-		;;
-	esac
-
-	return 0	# Returning 0 lets stop_filesystem do add'l checks
-}
-
-
-populate_defaults()
-{
-	if [ -z "$OCF_RESKEY_fstype" ]; then
-		export OCF_RESKEY_fstype=nfs
-	fi
-
-
-        case $OCF_RESKEY_fstype in
-	nfs|nfs4)
-		export OCF_RESKEY_device="$OCF_RESKEY_host:$OCF_RESKEY_export"
-		if [ -z "$OCF_RESKEY_options" ]; then
-			export OCF_RESKEY_options=sync,soft,noac
-		fi
-		;;
-	cifs)
-		export OCF_RESKEY_device="//$OCF_RESKEY_host/$OCF_RESKEY_export"
-		if [ -z "$OCF_RESKEY_options" ]; then
-			export OCF_RESKEY_options=guest
-		fi
-		;;
-	esac
-}
-
-
-#
-# Main...
-#
-populate_defaults
-main $*
diff --git a/rgmanager/src/resources/nfsclient.sh b/rgmanager/src/resources/nfsclient.sh
deleted file mode 100644
index 0437d32..0000000
--- a/rgmanager/src/resources/nfsclient.sh
+++ /dev/null
@@ -1,445 +0,0 @@
-#!/bin/bash
-
-#
-# NFS Export Client handler agent script
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent version="rgmanager 2.0" name="nfsclient">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines how a machine or group of machines may access
-        an NFS export on the cluster.  IP addresses, IP wildcards,
-	hostnames, hostname wildcards, and netgroups are supported.
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an NFS client.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" primary="1">
-            <longdesc lang="en">
-                This is a symbolic name of a client used to reference
-                it in the resource tree.  This is NOT the same thing
-                as the target option.
-            </longdesc>
-            <shortdesc lang="en">
-                Client Name
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="target" required="1">
-            <longdesc lang="en">
-                This is either a hostname, a wildcard (IP address or
-                hostname based), or a netgroup to which defining a
-                host or hosts to export to.
-            </longdesc>
-            <shortdesc lang="en">
-                Target Hostname, Wildcard, or Netgroup
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="path" inherit="path">
-            <longdesc lang="en">
-                This is the path to export to the target.  This
-                field is generally left blank, as it inherits the
-                path from the parent export.
-            </longdesc>
-            <shortdesc lang="en">
-                Path to Export
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="svcname" inherit="service%name">
-            <longdesc lang="en">
-            </longdesc>
-            <shortdesc lang="en">
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-
-        <parameter name="fsid" inherit="fsid">
-            <longdesc lang="en">
-	    	File system ID inherited from the parent nfsexport/
-		clusterfs/fs resource.  Putting fsid in the options
-		field will override this.
-            </longdesc>
-            <shortdesc lang="en">
-	    	File system ID
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="options">
-            <longdesc lang="en">Defines a list of options for this
-                particular client.  See 'man 5 exports' for a list
-                of available options.
-            </longdesc>
-            <shortdesc lang="en">
-                Export Options
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="allow_recover">
-            <longdesc lang="en">
-		Allows recovery of this NFS client (default = 1) if it
-		disappears from the export list.  If set to 0, the service
-		will be restarted.  This is useful to help preserve export
-		ordering.
-            </longdesc>
-            <shortdesc lang="en">
-		Allow recovery
-            </shortdesc>
-            <content type="boolean"/>
-        </parameter>
-
-	<parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-		Service this NFS export belongs to.  Used for caching
-		exports on a per-service basis.
-            </longdesc>
-            <shortdesc lang="en">
-                Service Name
-            </shortdesc>
-	    <content type="string"/>
-	</parameter>
-
-	<parameter name="use_cache" inherit="service%nfs_client_cache">
-            <longdesc lang="en">
-	   	On systems with large numbers of exports, a performance
-		problem in the exportfs command can cause inordinately long
-		status check times for services with lots of mounted
-		NFS clients.  This occurs because exportfs does DNS queries
-		on all clients in the export list.
-
-		Setting this option to '1' will enable caching of the export
-		list returned from the exportfs command on a per-service
-		basis.  The cache will last for 30 seconds before expiring
-		instead of being generated each time an nfsclient resource
-		is called.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Enable exportfs list caching
-            </shortdesc>
-	    <content type="integer"/>
-	</parameter>
-
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="90"/>
-        <action name="stop" timeout="5"/>
-        <action name="recover" timeout="90"/>
-
-	<!-- Checks to see if the export exists in /var/lib/nfs/etab -->
-        <action name="status" timeout="5" interval="1m"/>
-        <action name="monitor" timeout="5" interval="1m"/>
-
-        <action name="meta-data" timeout="5"/>
-        <action name="validate-all" timeout="30"/>
-    </actions>
-
-</resource-agent>
-EOT
-}
-
-
-verify_options()
-{
-	declare o
-	declare -i ret=0
-
-	[ -z "$OCF_RESKEY_options" ] && return 0
-	
-	#
-	# From exports(5)
-	#
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-		case $o in
-		fsid=*)
-			ocf_log debug "Using designated $o instead of fsid=$OCF_RESKEY_fsid"
-			unset OCF_RESKEY_fsid
-			;;
-		secure)
-			;;
-		insecure)
-			;;
-
-		rw)
-			;;
-		ro)
-			;;
-		async)
-			;;
-		sync)
-			;;
-		wdelay)
-			;;
-		no_wdelay)
-			;;
-		hide)
-			;;
-		nohide)
-			;;
-		subtree_check)
-			;;
-		no_subtree_check)
-			;;
-		secure_locks)
-			;;
-		insecure_locks)
-			;;
-		auth_nlm)
-			;;
-		no_auth_nlm)
-			;;
-		mountpoint=*)
-			;;
-		mp=*)
-			;;
-		root_squash)
-			;;
-		no_root_squash)
-			;;
-		all_squash)
-			;;
-		no_all_squash)
-			;;
-		anonuid=*)
-			;;
-		anongid=*)
-			;;
-		*)
-			ocf_log err "Export Option $o invalid"
-			ret=$OCF_ERR_ARGS
-			;;
-		esac
-	done
-
-	return $ret
-}
-
-
-verify_target()
-{
-	# XXX need to add wildcards, hostname, ip, etc.
-	[ -n "$OCF_RESKEY_target" ] && return 0
-	
-	return $OCF_ERR_ARGS
-}
-
-
-verify_path()
-{
-	if [ -z "$OCF_RESKEY_path" ]; then
-		ocf_log err "No export path specified."
-		return $OCF_ERR_ARGS
-	fi
-
-	[ -d "$OCF_RESKEY_path" ] && return 0
-
-	ocf_log err "$OCF_RESKEY_path is not a directory"
-	
-	return $OCF_ERR_ARGS
-}
-
-
-verify_type()
-{
-	[ -z "$OCF_RESKEY_type" ] && return 0
-	[ "$OCF_RESKEY_type" = "nfs" ] && return 0
-
-	ocf_log err "Export type $OCF_RESKEY_type not supported yet"
-	return $OCF_ERR_ARGS
-}
-
-
-verify_all()
-{
-	declare -i ret=0
-
-	verify_type || ret=$OCF_ERR_ARGS
-	verify_options || ret=$OCF_ERR_ARGS
-	verify_target || ret=$OCF_ERR_ARGS
-	verify_path || ret=$OCF_ERR_ARGS
-
-	return $ret
-}
-
-
-case $1 in
-start)
-	declare option_str
-
-	verify_all || exit $OCF_ERR_ARGS
-
-	#
-	# XXX
-	# Bad: Side-effect of verify_options: unset OCF_RESKEY_fsid if
-	# fsid is specified in the options string.
-	#
-	if [ -z "$OCF_RESKEY_options" ] && [ -n "$OCF_RESKEY_fsid" ]; then
-		option_str="fsid=$OCF_RESKEY_fsid"
-	elif [ -n "$OCF_RESKEY_options" ] && [ -z "$OCF_RESKEY_fsid" ]; then
-		option_str="$OCF_RESKEY_options"
-	elif [ -n "$OCF_RESKEY_fsid" ] && [ -n "$OCF_RESKEY_options" ]; then
-		option_str="fsid=$OCF_RESKEY_fsid,$OCF_RESKEY_options"
-	fi
-
-	if [ -z "$option_str" ]; then
-		ocf_log info "Adding export: ${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-		exportfs -i "${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-		rv=$?
-	else
-		ocf_log info "Adding export: ${OCF_RESKEY_target}:${OCF_RESKEY_path} ($option_str)"
-		exportfs -i -o $option_str "${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-		rv=$?
-	fi
-	;;
-
-stop)
-	verify_all || exit $OCF_ERR_ARGS
-
-	ocf_log info "Removing export: ${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-	exportfs -u "${OCF_RESKEY_target}:${OCF_RESKEY_path}"
-	rv=$?
-	;;
-
-status|monitor)
-	verify_all || exit $OCF_ERR_ARGS
-
-	if [ "${OCF_RESKEY_target}" = "*" ]; then
-		export OCF_RESKEY_target="\<world\>"
-	fi
-
-	#
-	# Status check fix from Birger Wathne:
-	# * Exports longer than 14 chars have line breaks inserted, which
-	#   broke the way the status check worked.
-	#
-        # Status check fix from Craig Lewis: 
-        # * Exports with RegExp metacharacters need to be escaped. 
-        #   These metacharacters are: * ? . 
-        # 
-	export OCF_RESKEY_target_regexp=$(echo $OCF_RESKEY_target | \
-		sed -e 's/*/[*]/g' -e 's/?/[?]/g' -e 's/\./\\./g') 
-
-	declare tmpfn
-	declare time_created time_now
-	declare -i delta=0
-
-	#
-	# Don't let anyone read the cache files.
-	#
-	umask 066
-
-	mkdir -p /var/cache/cluster
-
-	if [ -n "$OCF_RESKEY_service_name" ] && [ "$OCF_RESKEY_use_cache" = "1" ]; then
-
-		#
-		# For large #s of exports, we need to cache the information
-		#
-		tmpfn=/var/cache/cluster/nfsclient-status-cache-$OCF_RESKEY_service_name
-
-		if [ -f "$tmpfn" ]; then
-			time_created=$(stat -c "%Y" $tmpfn)
-			time_now=$(date +"%s")
-			delta=$((time_now-time_created))
-		fi
-		#echo "Cache age = $delta seconds"
-	else
-		delta=100
-		#
-		# Create a different file if this is a separate instance
-		#
-		tmpfn=/var/cache/cluster/nfsclient-status-cache-$$
-	fi
-
-	if ! [ -f "$tmpfn" ] || [ $delta -gt 30 ]; then
-		#echo "Create $tmpfn. Nonexistent / expired / no service name"
-		exportfs -v > $tmpfn
-	fi
-
-        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -iq \
-		"^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_regexp}" 
-	rv=$? 
-
-	if [ $rv -eq 0 ]; then
-		[ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
-		exit 0
-	fi
-
-	declare OCF_RESKEY_target_tmp=$(clufindhostname -i "$OCF_RESKEY_target")
-	if [ $? -ne 0 ]; then
-		[ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
-		ocf_log err "nfsclient:$OCF_RESKEY_name is missing!"
-		exit 1
-	fi
-
-        cat $tmpfn | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \
-		"^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_tmp}" 
-	rv=$? 
-
-	[ "$OCF_RESKEY_use_cache" = "1" ] || rm -f $tmpfn
-	if [ $rv -eq 0 ]; then
-		exit 0
-	fi
-
-	ocf_log err "nfsclient:$OCF_RESKEY_name is missing!"
-	exit 1
-	;;
-
-recover)
-	if [ "$OCF_RESKEY_allow_recover" = "0" ] || \
-	   [ "$OCF_RESKEY_allow_recover" = "no" ] || \
-	   [ "$OCF_RESKEY_allow_recover" = "false" ]; then
-		exit 1
-	fi
-
-	$0 stop || exit 1
-	$0 start || exit 1
-	;;
-
-restart)
-	#
-	# Recover might better be "exportfs -r" - reexport
-	#
-	$0 stop || exit 1
-	$0 start || exit 1
-	;;
-
-meta-data)
-	meta_data
-	exit 0
-	;;
-
-validate-all)
-	verify_all
-	rv=$?
-	;;
-
-*)
-	echo "usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-	rv=$OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-exit $rv
diff --git a/rgmanager/src/resources/nfsexport.sh b/rgmanager/src/resources/nfsexport.sh
deleted file mode 100644
index b013a5e..0000000
--- a/rgmanager/src/resources/nfsexport.sh
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/bin/bash
-
-#
-# NFS Export Script.  Handles starting/stopping clurmtabd and doing
-# the strange NFS stuff to get it to fail over properly.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-
-rmtabpid=""
-nfsop_arg=""
-rv=0
-
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="nfsexport" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an NFS export path.  Generally, these are
-        defined inline and implicitly; you should not have to 
-        configure one of these.  All of the relevant information
-        is inherited from the parent.
-    </longdesc>
-
-    <shortdesc lang="en">
-        This defines an NFS export.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-            <longdesc lang="en">
-                Descriptive name for this export.  Generally, only
-                one export is ever defined, and it's called "generic
-                nfs export".
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="device" inherit="device">
-            <longdesc lang="en">
-                If you can see this, your GUI is broken.
-            </longdesc>
-            <shortdesc lang="en">
-                If you can see this, your GUI is broken.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="path" inherit="mountpoint">
-            <longdesc lang="en">
-                If you can see this, your GUI is broken.
-            </longdesc>
-            <shortdesc lang="en">
-                If you can see this, your GUI is broken.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="fsid" inherit="fsid">
-            <longdesc lang="en">
-                If you can see this, your GUI is broken.
-            </longdesc>
-            <shortdesc lang="en">
-                If you can see this, your GUI is broken.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="5"/>
-	<action name="stop" timeout="5"/>
-	<action name="recover" timeout="5"/>
-
-	<!-- NFS Exports really don't do anything except provide a path
-	     for nfs clients.  So, status and monitor are no-ops -->
-	<action name="status" timeout="5" interval="1h"/>
-	<action name="monitor" timeout="5" interval="1h"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="30"/>
-    </actions>
-
-    <special tag="rgmanager">
-	<child type="nfsexport" forbid="1"/>
-	<child type="nfsclient"/>
-    </special>
-
-</resource-agent>
-EOT
-}
-
-
-verify_device()
-{
-	if [ -z "$OCF_RESKEY_device" ]; then
-	       ocf_log err "No device or label specified."
-	       return $OCF_ERR_ARGS
-	fi
-
-	[ -b "$OCF_RESKEY_device" ] && return 0
-	[ -b "`findfs $OCF_RESKEY_device`" ] && return 0
-
-	ocf_log err "Device or label \"$OCF_RESKEY_device\" not valid"
-
-	return $OCF_ERR_ARGS
-}
-
-
-verify_path()
-{
-	if [ -z "$OCF_RESKEY_path" ]; then
-		ocf_log err "No export path specified."
-		return $OCF_ERR_ARGS
-	fi
-
-	[ -d "$OCF_RESKEY_path" ] && return 0
-
-	ocf_log err "$OCF_RESKEY_path is not a directory"
-	
-	return $OCF_ERR_ARGS
-}
-
-
-verify_all()
-{
-	declare -i ret=0
-
-	verify_device || ret=$OCF_ERR_ARGS
-	verify_path || ret=$OCF_ERR_ARGS
-
-	return $ret
-}
-
-
-#
-# Check if the NFS daemons are running.
-#
-nfs_daemons_running()
-{
-    declare NFS_DAEMONS="nfsd rpc.mountd rpc.statd"
-
-    for daemon in $NFS_DAEMONS; do
-        ps -ef | grep "$daemon" | grep -v grep >/dev/null 2>&1
-        if [ $? -ne 0 ]; then
-	    ocf_log err \
-            "NFS daemon $daemon is not running."
-	    ocf_log err \
-            "Verify that the NFS service run level script is enabled."
-            return 1
-        fi
-    done
-
-    return 0
-}
-
-
-nfs_check()
-{
-	declare junk
-
-	if nfs_daemons_running; then
-		return 0
-	fi
-
-	#
-	# Don't restart daemons during status check.
-	#
-	if [ "$1" = "status" ]; then
-		return 1;
-	fi
-		
-  	ocf_log err "Restarting NFS daemons"
-	# Note restart does less than stop/start
-	junk=$(/sbin/service nfslock stop)
-	junk=$(/sbin/service nfslock start)
-	junk=$(/sbin/service nfs stop)
-	junk=$(/sbin/service nfs start)
-	sleep 2
-	
-	if ! nfs_daemons_running; then
-		ocf_log err "Failed restarting NFS daemons"
-    		return 1
-	fi
-	ocf_log notice "Successfully restarted NFS daemons"
-}
-
-
-case $1 in
-start)
-	nfs_check start || exit 1
-	rv=0
-	;;
-
-status|monitor)
-	nfs_check status || exit 1
-	rv=0
-	;;
-		    
-stop)
-	nfs_check restart || exit 1
-	rv=0
-	;;
-
-recover|restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	rv=0
-	;;
-
-meta-data)
-	meta_data
-	rv=0
-	;;
-
-validate-all)
-	verify_all
-	rv=$?
-	;;
-*)
-	echo "usage: $0 {start|status|monitor|stop|recover|restart|meta-data|validate-all}"
-	exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-exit $rv
diff --git a/rgmanager/src/resources/nfsserver.sh b/rgmanager/src/resources/nfsserver.sh
deleted file mode 100644
index 17f472d..0000000
--- a/rgmanager/src/resources/nfsserver.sh
+++ /dev/null
@@ -1,489 +0,0 @@
-#!/bin/bash
-
-#
-# NFS Server Script.  Handles starting/stopping Servand doing
-# the strange NFS stuff to get it to fail over properly.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-V4RECOVERY="/var/lib/nfs/v4recovery"
-PROC_V4RECOVERY="/proc/fs/nfsd/nfsv4recoverydir"
-
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-log_do()
-{
-	ocf_log debug $*
-	$* &> /dev/null
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		ocf_log debug "Failed: $*"
-	fi
-	return $ret
-}
-
-
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="nfsserver" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an NFS server resource.  The NFS server
-	resource is useful for exporting NFSv4 file systems
-	to clients.  Because of the way NFSv4 works, only
-	one NFSv4 resource may exist on a server at a
-	time.  Additionally, it is not possible to use
-	the nfsserver resource when also using local instances
-	of NFS on each cluster node.
-    </longdesc>
-
-    <shortdesc lang="en">
-        This defines an NFS server resource.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-            <longdesc lang="en">
-                Descriptive name for this server.  Generally, only
-                one server is ever defined per service.
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="path" inherit="mountpoint">
-            <longdesc lang="en">
-	        This is the path you intend to export.  Usually, this is
-		left blank, and the mountpoint of the parent file system
-		is used.  This path is passed to nfsclient resources as
-		the export path when exportfs is called.
-            </longdesc>
-            <shortdesc lang="en">
-	    	This is the path you intend to export.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="nfspath">
-            <longdesc lang="en">
-	        This is the path containing shared NFS information which
-		is used for NFS recovery after a failover.  This
-		is relative to the export path, and defaults to
-		".clumanager/nfs".
-            </longdesc>
-            <shortdesc lang="en">
-	        This is the path containing shared NFS recovery
-		information, relative to the path parameter.
-            </shortdesc>
-	    <content type="string" default=".clumanager/nfs"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="5"/>
-	<action name="stop" timeout="5"/>
-	<action name="recover" timeout="5"/>
-
-	<action name="status" timeout="5" interval="30"/>
-	<action name="monitor" timeout="5" interval="30"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="30"/>
-    </actions>
-
-    <special tag="rgmanager">
-    	<attributes maxinstances="1"/>
-	<child type="nfsexport" forbid="1"/>
-	<child type="nfsserver" forbid="1"/>
-	<child type="nfsclient" start="1" stop="2"/>
-	<child type="ip" start="2" stop="1"/>
-    </special>
-
-</resource-agent>
-EOT
-}
-
-
-verify_path()
-{
-	if [ -z "$OCF_RESKEY_path" ]; then
-		ocf_log err "No server path specified."
-		return $OCF_ERR_ARGS
-	fi
-
-	[ -d "$OCF_RESKEY_path" ] && return 0
-
-	ocf_log err "$OCF_RESKEY_path is not a directory"
-	
-	return $OCF_ERR_ARGS
-}
-
-
-verify_nfspath()
-{
-	if [ -z "$OCF_RESKEY_nfspath" ]; then
-		echo No NFS data path specified.
-		return 1
-	fi
-
-	[ -d "$OCF_RESKEY_path" ] && return 0
-	
-	# xxx do nothing for now.
-	return 0
-}
-
-
-verify_all()
-{
-	verify_path || return 1
-	verify_nfspath || return 1
-
-	return 0
-}
-
-
-nfs_daemons()
-{
-	declare oper
-	declare val
-
-	case $1 in
-	start)
-		ocf_log info "Starting NFS daemons"
-		/etc/init.d/nfs start
-		if [ $? -ne 0 ]; then
-			ocf_log err "Failed to start NFS daemons"
-			return 1
-		fi
-
-		ocf_log debug "NFS daemons are running"
-		return 0
-		;;
-	stop)
-		ocf_log info "Stopping NFS daemons"
-		if ! /etc/init.d/nfs stop; then
-			ocf_log err "Failed to stop NFS daemons"
-			return 1
-		fi
-
-		ocf_log debug "NFS daemons are stopped"
-
-		return 0
-		;;
-	status|monitor)
-		declare recoverydir="$OCF_RESKEY_path/$OCF_RESKEY_nfspath/v4recovery"
-		val=$(cat $PROC_V4RECOVERY)
-
-		[ "$val" = "$recoverydir" ] || ocf_log warning \
-			"NFSv4 recovery directory is $val instead of $recoverydir"
-		/etc/init.d/nfs status
-		if [ $? -eq 0 ]; then
-			ocf_log debug "NFS daemons are running"
-			return 0
-		fi
-		return 1
-		;;
-	esac
-}
-
-
-create_tree()
-{
-	declare fp="$OCF_RESKEY_path/$OCF_RESKEY_nfspath"
-
-	[ -d "$fp" ] || mkdir -p "$fp"
-
-	[ -d "$fp/statd" ] || mkdir -p "$fp/statd"
-	[ -d "$fp/v4recovery" ] || mkdir -p "$fp/v4recovery"
-
-	#
-	# Create our own private copy which we use for notifies.
-	# This way, we can be sure to advertise on possibly multiple
-	# IP addresses.
-	#
-	[ -d "$fp/statd/sm" ] || mkdir -p "$fp/statd/sm"
-	[ -d "$fp/statd/sm.bak" ] || mkdir -p "$fp/statd/sm.bak"
-	[ -d "$fp/statd/sm-ha" ] || mkdir -p "$fp/statd/sm-ha"
-	[ -n "`id -u rpcuser`" -a "`id -g rpcuser`" ] && chown -R rpcuser.rpcuser "$fp/statd"
-
-	# Create if they don't exist
-	[ -f "$fp/etab" ] || touch "$fp/etab"
-	[ -f "$fp/xtab" ] || touch "$fp/xtab"
-	[ -f "$fp/rmtab" ] || touch "$fp/rmtab"
-
-        #
-        # Generate a random state file.  If this ends up being what a client
-        # already has in its list, that's bad, but the chances of this
-        # are small - and relocations should be rare.
-        #
-        dd if=/dev/urandom of=$fp/state bs=1 count=4 &> /dev/null
-	[ -n "`id -u rpcuser`" -a "`id -g rpcuser`" ] && chown rpcuser.rpcuser "$fp/state"
-}
-
-setup_v4recovery()
-{
-	declare recoverydir="$OCF_RESKEY_path/$OCF_RESKEY_nfspath/v4recovery"
-
-	# mounts /proc/fs/nfsd for us
-	lsmod | grep -q nfsd
-	if [ $? -ne 0 ]; then
-		modprobe nfsd
-	fi
-
-	val=$(cat "$PROC_V4RECOVERY")
-
-	# Ensure start-after-start works
-	if [ "$val" = "$recoverydir" ]; then
-		return 0
-	fi
-
-	#
-	# If the value is not default, there may be another
-	# cluster service here already which has replaced
-	# the v4 recovery directory.  In that case,
-	# we must refuse to go any further.
-	#
-	if [ "$val" != "$V4RECOVERY" ]; then
-		ocf_log err "NFSv4 recovery directory has an unexpected value: $val"
-		return 1
-	fi
-
-	#
-	# Redirect nfs v4 recovery dir to shared storage
-	#
-	echo "$recoverydir" > "$PROC_V4RECOVERY"
-	if [ $? -ne 0 ]; then
-		echo "Uh oh... echo failed!?"
-	fi
-
-	val="$(cat $PROC_V4RECOVERY)"
-	if [ "$val" != "$recoverydir" ]; then
-		ocf_log err "Failed to change NFSv4 recovery path"
-		ocf_log err "Wanted: $recoverydir; got $val"
-		return 1
-	fi
-
-	return 0
-}
-
-
-cleanup_v4recovery()
-{
-	#
-	# Restore nfsv4 recovery directory to default
-	#
-	echo "$V4RECOVERY" > "$PROC_V4RECOVERY"
-	return $?
-}
-
-
-is_bound()
-{
-	mount | grep -q "$1 on $2 type none (.*bind.*)"
-	return $?
-}
-
-
-setup_tree()
-{
-	declare fp="$OCF_RESKEY_path/$OCF_RESKEY_nfspath"
-
-	if is_bound $fp/statd /var/lib/nfs/statd; then
-		ocf_log debug "$fp is already bound to /var/lib/nfs/statd"
-		return 0
-	fi
-
-	mount -o bind "$fp/statd" /var/lib/nfs/statd
-	cp -a "$fp"/*tab /var/lib/nfs
-	restorecon /var/lib/nfs
-}
-
-
-cleanup_tree()
-{
-	declare fp="$OCF_RESKEY_path/$OCF_RESKEY_nfspath"
-
-	if is_bound "$fp/statd" /var/lib/nfs/statd; then
-		log_do umount /var/lib/nfs/statd || return 1
-	else
-		ocf_log debug "$fp is not bound to /var/lib/nfs/statd"
-	fi
-
-	cp -a /var/lib/nfs/*tab "$fp"
-
-	return 0
-}
-
-start_locking()
-{
-	declare ret
-	[ -x /sbin/rpc.statd ] || return 1
-	
-	#
-	# Synchronize these before starting statd
-	#
-	cp -f /var/lib/nfs/statd/sm-ha/* /var/lib/nfs/statd/sm 2> /dev/null
-	cp -f /var/lib/nfs/statd/sm/* /var/lib/nfs/statd/sm-ha 2> /dev/null
-
-	if pidof rpc.statd &> /dev/null; then
-		ocf_log debug "rpc.statd is already running"
-		return 0
-	fi
-
-	#
-	# Set this resrouce script as the callout program.  We are evil.
-	# In cases where we want to preserve lock information, this is needed
-	# because we can't do the "copy" that we do on the down-state...
-	#
-	ocf_log info "Starting rpc.statd"
-	rm -f /var/run/sm-notify.pid
-	rpc.statd -H $0 -d
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		ocf_log err "Failed to start rpc.statd"
-		return $ret
-	fi
-	touch /var/lock/subsys/nfslock
-	return $ret
-}
-
-
-terminate()
-{
-	declare pids
-	declare i=0
-
-	while : ; do
-		pids=$(pidof $1)
-		[ -z "$pids" ] && return 0
-	 	kill $pids
-		sleep 1
-		((i++))
-		[ $i -gt 3 ] && return 1
-	done
-}
-
-
-killkill()
-{
-	declare pids
-	declare i=0
-
-	while : ; do
-		pids=$(pidof $1)
-		[ -z "$pids" ] && return 0
-	 	kill -9 $pids
-		sleep 1
-		((i++))
-		[ $i -gt 3 ] && return 1
-	done
-}
-
-
-stop_locking()
-{
-	declare ret 
-
-	ocf_log info "Stopping rpc.statd"
-	if terminate rpc.statd; then
-		ocf_log debug "rpc.statd is stopped"
-	else
-		if killkill rpc.statd; then
-			ocf_log debug "rpc.statd is stopped"
-		else
-			ocf_log debug "Failed to stop rpc.statd"
-			return 1
-		fi
-	fi
-}
-
-
-case $1 in
-start)
-	# Check for and source configuration file
-	ocf_log info "Starting NFS Server $OCF_RESKEY_name"
-	create_tree || exit 1
-	setup_tree || exit 1
-	setup_v4recovery || exit 1
-
-	start_locking
-	nfs_daemons start
-	rv=$?
-	if [ $rv -eq 0 ]; then
-		ocf_log info "Started NFS Server $OCF_RESKEY_name"
-		exit 0
-	fi
-
-	ocf_log err "Failed to start NFS Server $OCF_RESKEY_name"
-	exit $rv
-	;;
-
-status|monitor)
-	nfs_daemons status 
-	exit $?
-	;;
-		    
-stop)
-	if ! nfs_daemons stop; then
-		ocf_log err "Failed to stop NFS Server $OCF_RESKEY_name"
-		exit $OCF_ERR_GENERIC
-	fi
-
-	# Copy the current notify list into our private area
-	ocf_log debug "Copying sm files for future notification..."
-	rm -f /var/lib/nfs/statd/sm-ha/* &> /dev/null
-	cp -f /var/lib/nfs/statd/sm/* /var/lib/nfs/statd/sm-ha &> /dev/null
-
-	stop_locking || exit 1
-	cleanup_v4recovery
-	cleanup_tree || exit 1
-	exit 0
-	;;
-
-add-client)
-	ocf_log debug "$0 $1 $2 $3"
-	touch /var/lib/nfs/statd/sm/$2
-	touch /var/lib/nfs/statd/sm-ha/$2
-	exit 0
-	;;
-
-del-client)
-	ocf_log debug "$0 $1 $2 $3"
-	touch /var/lib/nfs/statd/sm/$2
-	rm -f /var/lib/nfs/statd/sm-ha/$2
-	exit 0
-	;;
-
-recover|restart)
-	$0 stop || exit $OCF_ERR_GENERIC
-	$0 start || exit $OCF_ERR_GENERIC
-	exit 0
-	;;
-
-meta-data)
-	meta_data
-	exit 0
-	;;
-
-validate-all)
-	verify_all
-	exit $?
-	;;
-*)
-	echo "usage: $0 {start|stop|status|monitor|restart|recover|add-client|del-client|meta-data|validate-all}"
-	exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
-exit 0
diff --git a/rgmanager/src/resources/ocf-shellfuncs b/rgmanager/src/resources/ocf-shellfuncs
deleted file mode 100644
index 3f7051a..0000000
--- a/rgmanager/src/resources/ocf-shellfuncs
+++ /dev/null
@@ -1,165 +0,0 @@
-#! /bin/bash
-#
-# 	$Id$
-#
-# 	Common helper functions for the OCF Resource Agents supplied by
-# 	heartbeat.
-
-
-# TODO: Some of this should probably split out into a generic OCF
-# library for shell scripts, but for the time being, we'll just use it
-# ourselves...
-#
-
-# TODO wish-list:
-# - Generic function for evaluating version numbers
-# - Generic function(s) to extract stuff from our own meta-data
-# - Logging function which automatically adds resource identifier etc
-#   prefixes
-# TODO: Move more common functionality for OCF RAs here.
-#
-__SCRIPT_NAME=`basename $0`
-
-# lhh - determine if we're a dumb terminal
-consoletype &> /dev/null
-if [ $? -eq 1 ]; then
-	__SERIAL="yes"
-fi
-
-__LOG_PID=$PPID
-__LOG_NAME=$(basename $(readlink /proc/$PPID/exe))
-
-pretty_echo() {
-	declare pretty
-	declare n=""
-        declare __OCF_PRIO="$1"
-        shift
-        declare __OCF_MSG="$*"
-
-	if [ -n "$__SERIAL" ]; then
-		echo "<$__OCF_PRIO> $__OCF_MSG"
-		return 0
-	fi
-
-	case $__OCF_PRIO in
-	emerg)		pretty="";;
-	alert)		pretty="";;
-        crit|critical)	pretty="";;
-        err|error)	pretty="";;
-        warn|warning)	pretty="";;
-	note|notice)	pretty="";;
-        info)		pretty="";;
-        debug|dbg)	pretty="";;
-        *)		pretty="";;
-	esac
-
-	echo "$n<$pretty$__OCF_PRIO$n> $__OCF_MSG"
-	return 0
-}
-
-__ocf_set_defaults() {
-	__OCF_ACTION="$1"
-
-	# Return to sanity for the agents...
-	unset LANG
-	LC_ALL=C
-	export LC_ALL
-
-	# TODO: Review whether we really should source this. Or rewrite
-	# to match some emerging helper function syntax...? This imports
-	# things which no OCF RA should be using...
-
-	OCF_SUCCESS=0
-	OCF_ERR_GENERIC=1
-	OCF_ERR_ARGS=2
-	OCF_ERR_UNIMPLEMENTED=3
-	OCF_ERR_PERM=4
-	OCF_ERR_INSTALLED=5
-	OCF_ERR_CONFIGURED=6
-	OCF_NOT_RUNNING=7
-
-	if [ -z "$OCF_RESOURCE_TYPE" ]; then
-		: ${OCF_RESOURCE_TYPE:=$__SCRIPT_NAME}
-	fi
-
-	if [ -z "$OCF_RA_VERSION_MAJOR" ]; then
-		: We are being invoked as an init script.
-		: Fill in some things with reasonable values.
-		: ${OCF_RESOURCE_INSTANCE:="default"}
-		return 0
-        fi
-
-	if [ -z "$OCF_ROOT" ]; then
-		OCF_ROOT=$(dirname $0)
-	fi
-	if [ ! -d "$OCF_ROOT" ]; then
-		ocf_log err "OCF_ROOT points to non-directory $OCF_ROOT."
-		exit $OCF_ERR_GENERIC
-	fi
-
-	# TODO: Anything else we should be setting and thus checking?
-        # There is nothing in this script which depends on the version
-	# of the API.  TESTING THIS HERE IS A BUG.  THIS SHOULD BE
-	# tested by the script that's invoked us.  FIXME!!
-	if [ "x$OCF_RA_VERSION_MAJOR" != "x1" ]; then
-		ocf_log err "This script is OCF RA API 1.x compliant only!"
-		exit $OCF_ERR_UNIMPLEMENTED
-	fi
-	# TODO: Should the minor level really be a number and not rather
-	# a list of flags...?
-        # AlanR says -- absolutely not -- a list of flags is good for a list
-	# of implemented features, not a version compiliance
-	# perhaps some future version might have such a list of
-	# flags, but that would be _in addition to_ the minor version number
-	if [ -z "$OCF_RA_VERSION_MINOR" ]; then
-		ocf_log err "No OCF RA minor version set."
-		exit $OCF_ERR_UNIMPLEMENTED
-	fi
-
-	if [ "x$__OCF_ACTION" = "xmeta-data" ]; then
-		OCF_RESOURCE_INSTANCE="undef"
-	fi	
-
-	if [ -z "$OCF_RESOURCE_INSTANCE" ]; then
-		ocf_log err "Need to tell us our resource instance name."
-		exit $OCF_ERR_ARGS
-	fi
-}
-
-
-ocf_log() {
-	# TODO: Revisit and implement internally.
-	if
-          [ $# -lt 2 ]
-        then
-          ocf_log err "Not enough arguments [$#] to ocf_log."
-        fi
-
-        declare __OCF_PRIO="$1"
-	declare -i __OCF_PRIO_N
-
-        shift
-
-        declare __OCF_MSG="$*"
-
-        case "${__OCF_PRIO}" in
-	emerg)		__OCF_PRIO_N=0;; # Not in original ocf-shellfuncs
-	alert)		__OCF_PRIO_N=1;; # Not in original ocf-shellfuncs
-        crit|critical)	__OCF_PRIO_N=2;;
-        err|error)	__OCF_PRIO_N=3;;
-        warn|warning)	__OCF_PRIO_N=4;;
-	note|notice)	__OCF_PRIO_N=5;; # Not in original ocf-shellfuncs
-        info)		__OCF_PRIO_N=6;;
-        debug|dbg)	__OCF_PRIO_N=7;;
-        *)		__OCF_PRIO_N=5;; # Defaults to INFO
-	esac
-
-	pretty_echo $__OCF_PRIO "$__OCF_MSG"
-
-	if [ -z "`which clulog 2> /dev/null`" ]; then
-		return 0
-	fi
-	clulog -m "$OCF_RESOURCE_TYPE" -s $__OCF_PRIO_N "$__OCF_MSG"
-}
-
-__ocf_set_defaults "$@"
diff --git a/rgmanager/src/resources/openldap.metadata b/rgmanager/src/resources/openldap.metadata
deleted file mode 100644
index 9bd7193..0000000
--- a/rgmanager/src/resources/openldap.metadata
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="openldap">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of Open LDAP 
-    </longdesc>
-    <shortdesc lang="en">
-        Defines an Open LDAP server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/openldap/slapd.conf"/>
-        </parameter>
-
-        <parameter name="url_list">
-            <longdesc lang="en">
-               Serve URL list. Default behaviour of URL list is changed and 
-		enhanced. eg. ldap:/// won't bind all IP address on the
-		computer but to all IP addresses in service. Using
-		ldap://0:port/ will bind to all IP addresses for service on
-		given port.
-            </longdesc>
-            <shortdesc lang="en">
-                URL list
-            </shortdesc>
-	    <content type="string" default="ldap:///"/>
-        </parameter>
-
-	<parameter name="slapd_options">
-		<longdesc lang="en">
-			Other command-line options for slapd
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for slapd
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/openldap.sh b/rgmanager/src/resources/openldap.sh
deleted file mode 100644
index 49ff81f..0000000
--- a/rgmanager/src/resources/openldap.sh
+++ /dev/null
@@ -1,209 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare LDAP_SLAPD=/usr/sbin/slapd
-declare LDAP_pid_file="`generate_name_for_pid_file`"
-declare LDAP_conf_dir="`generate_name_for_conf_dir`"
-declare LDAP_gen_config_file="$LDAP_conf_dir/slapd.conf"
-declare LDAP_url_list
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_url_list()
-{
-	declare ldap_url_source=$1
-	declare ip_addresses=$2
-	declare url_list
-	declare tmp;
-	
-	for u in $ldap_url_source; do 
-		if [[ "$u" =~ ':///' ]]; then
-			for z in $ip_addresses; do
-				tmp=`echo $u | sed "s,://,://$z,"`
-				url_list="$url_list $tmp"
-			done
-		elif [[ "$u" =~ '://0:' ]]; then
-			for z in $ip_addresses; do
-				tmp=`echo $u | sed "s,://0:,://$z:,"`
-				url_list="$url_list $tmp"
-			done
-		else
-			url_list="$url_list $u"
-		fi
-	done
-	
-	echo $url_list
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	generate_configTemplate "$generated_file" "$1"
-	echo "pidfile \"$LDAP_pid_file\"" >> $generated_file
-	echo >> $generated_file	
-	sed 's/^[[:space:]]*pidfile/### pidfile/i' < "$original_file" >> "$generated_file"
-	
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$LDAP_conf_dir"
-	check_pid_file "$LDAP_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$LDAP_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	LDAP_url_list=`generate_url_list "$OCF_RESKEY_url_list" "$ip_addresses"`
-
-	if [ -z "$LDAP_url_list" ]; then
-		ocf_log error "Generating URL List for $OCF_RESOURCE_INSTANCE > Failed"
-		return $OCF_ERR_GENERIC
-	fi
-
-	generate_config_file "$OCF_RESKEY_config_file" "$LDAP_gen_config_file"
-
-	$LDAP_SLAPD -f "$LDAP_gen_config_file" -n "$OCF_RESOURCE_INSTANCE" \
-		-h "$LDAP_url_list" $OCF_RESKEY_slapd_options
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$LDAP_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$LDAP_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$LDAP_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/oracledb.sh.in b/rgmanager/src/resources/oracledb.sh.in
deleted file mode 100644
index 5ba3370..0000000
--- a/rgmanager/src/resources/oracledb.sh.in
+++ /dev/null
@@ -1,886 +0,0 @@
-#!/bin/bash
-# Author(s):
-#     Hardy Merrill <hmerrill at redhat.com>
-#     Lon Hohberger <lhh at redhat.com>
-#     Michael Moon <Michael dot Moon at oracle.com>
-#
-# chkconfig: 345 99 01
-# description: Service script for starting/stopping      \
-#	       Oracle(R) Database 10g on                 \
-#		        Red Hat Enterprise Linux 5
-#
-# NOTES:
-#
-# (1) You can comment out the LOCKFILE declaration below.  This will prevent
-# the need for this script to access anything outside of the ORACLE_HOME 
-# path.
-#
-# (2) You MUST customize ORACLE_USER, ORACLE_HOME, ORACLE_SID, and
-# ORACLE_HOSTNAME to match your installation if not running from within
-# rgmanager.
-#
-# (3) Do NOT place this script in shared storage; place it in ORACLE_USER's
-# home directory in non-clustered environments and /usr/share/cluster
-# in rgmanager/Red Hat cluster environments.
-#
-# Oracle is a registered trademark of Oracle Corporation.
-# Oracle9i is a trademark of Oracle Corporation.
-# Oracle10g is a trademark of Oracle Corporation.
-# All other trademarks are property of their respective owners.
-#
-
-. /etc/init.d/functions
-
-#
-# Source stuff from /etc/sysconfig, but this may be overridden if
-# this is being called as a cluster resource agent instead.
-#. /etc/sysconfig/oracledb
-
-declare SCRIPT="`basename $0`"
-declare SCRIPTDIR="`dirname $0`"
-
-[ -n "$OCF_RESKEY_user" ] && ORACLE_USER=$OCF_RESKEY_user
-[ -n "$OCF_RESKEY_home" ] && ORACLE_HOME=$OCF_RESKEY_home
-[ -n "$OCF_RESKEY_name" ] && ORACLE_SID=$OCF_RESKEY_name
-[ -n "$OCF_RESKEY_listener_name" ] && ORACLE_LISTENER=$OCF_RESKEY_listener_name
-[ -n "$OCF_RESKEY_lockfile" ] && LOCKFILE=$OCF_RESKEY_lockfile
-[ -n "$OCF_RESKEY_type" ] && ORACLE_TYPE=$OCF_RESKEY_type
-[ -n "$OCF_RESKEY_vhost" ] && ORACLE_HOSTNAME=$OCF_RESKEY_vhost
-
-######################################################
-# Customize these to match your Oracle installation. #
-######################################################
-#
-# 1. Oracle user.  Must be the same across all cluster members.  In the event
-#    that this script is run by the super-user, it will automatically switch
-#    to the Oracle user and restart.  Oracle needs to run as the Oracle
-#    user, not as root.
-#
-#[ -n "$ORACLE_USER" ] || ORACLE_USER=oracle
-
-#
-# 2. Oracle home.  This is set up during the installation phase of Oracle.
-#    From the perspective of the cluster, this is generally the mount point
-#    you intend to use as the mount point for your Oracle Infrastructure
-#    service.
-#
-#[ -n "$ORACLE_HOME" ] || ORACLE_HOME=/mnt/oracle/home
-
-#
-# 3. This is your SID.  This is set up during oracle installation as well.
-#
-#[ -n "$ORACLE_SID" ] || ORACLE_SID=orcl
-
-#
-# 4. The oracle user probably doesn't have the permission to write to 
-# /var/lock/subsys, so use the user's home directory.
-#
-#[ -n "$LOCKFILE" ] || LOCKFILE="/home/$ORACLE_USER/.oracle-ias.lock"
-[ -n "$LOCKFILE" ] || LOCKFILE="$ORACLE_HOME/.oracle-ias.lock"
-#[ -n "$LOCKFILE" ] || LOCKFILE="/var/lock/subsys/oracle-ias" # Watch privileges
-
-#
-# 5. Type of Oracle Database.  Currently supported: 10g 10g-iAS(untested!)
-#
-[ -n "$ORACLE_TYPE" ] || ORACLE_TYPE="base-em"
-
-#
-# 6. Oracle virtual hostname.  This is the hostname you gave Oracle during
-#    installation.
-#
-#[ -n "$ORACLE_HOSTNAME" ] || ORACLE_HOSTNAME=svc0.foo.test.com
-
-
-
-###########################################################################
-ORACLE_TYPE=`echo $ORACLE_TYPE | tr A-Z a-z`
-export ORACLE_USER ORACLE_HOME ORACLE_SID LOCKFILE ORACLE_TYPE
-export ORACLE_HOSTNAME
-
-
-##########################
-# Set up paths we'll use.  Not all are used by all the different types of
-# Oracle installations
-#
-export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/opmn/lib
-export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/dcm/bin:$PATH
-
-declare -i	RESTART_RETRIES=3
-declare -r	DB_PROCNAMES="pmon"
-#declare -r	DB_PROCNAMES="pmonXX" # testing
-#declare -r	DB_PROCNAMES="pmon smon dbw0 lgwr"
-
-declare -r	LSNR_PROCNAME="tnslsnr"
-#declare -r	LSNR_PROCNAME="tnslsnrXX" # testing
-
-
-##########################################################
-# (Hopefully) No user-serviceable parts below this line. #
-##########################################################
-meta_data()
-{
-	cat <<EOT
-<?xml version="1.0" ?>
-<resource-agent name="oracledb" version="rgmanager 2.0">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-	Oracle 10g Failover Instance
-    </longdesc>
-    <shortdesc lang="en">
-	Oracle 10g Failover Instance
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-		Instance name (SID) of oracle instance
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle SID
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="listener_name" unique="1">
-	    <longdesc lang="en">
-		Oracle Listener Instance Name.  If you have multiple 
-		instances of Oracle running, it may be necessary to 
-		have multiple listeners on the same machine with
-		different names.
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle Listener Instance Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-
-        <parameter name="user" required="1">
-	    <longdesc lang="en">
-		Oracle user name.  This is the user name of the Oracle
-		user which the Oracle AS instance runs as.
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle User Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="home" required="1">
-	    <longdesc lang="en">
-		This is the Oracle (application, not user) home directory.
-		This is configured when you install Oracle.
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle Home Directory
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="type" required="0">
-	    <longdesc lang="en">
-		This is the Oracle installation type:
-		base - Database Instance and Listener only
-		base-em (or 10g) - Database, Listener, Enterprise Manager,
-				   and iSQL*Plus
-		ias (or 10g-ias) - Internet Application Server (Infrastructure)
-	    </longdesc>
-            <shortdesc lang="en">
-		Oracle Installation Type
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="vhost" required="0" unique="1">
-	    <longdesc lang="en">
-	        Virtual Hostname matching the installation hostname of
-		Oracle 10g.  Note that during the start/stop of an oracledb
-		resource, your hostname will temporarily be changed to
-		this hostname.  As such, it is recommended that oracledb
-		resources be instanced as part of an exclusive service only.
-	    </longdesc>
-            <shortdesc lang="en">
-		Virtual Hostname
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="900"/>
-	<action name="stop" timeout="90"/>
-        <action name="recover" timeout="990"/>
-
-	<!-- Checks to see if it's mounted in the right place -->
-	<action name="status" timeout="10"/>
-	<action name="monitor" timeout="10"/>
-
-	<action name="status" depth="10" timeout="30" interval="30"/>
-	<action name="monitor" depth="10" timeout="30" interval="30"/>
-
-	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="5"/>
-    </actions>
-
-    <special tag="rgmanager">
-	<attributes maxinstances="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-#
-# "action"-like macro supporting functions
-#
-faction()
-{
-	echo -n "$1"
-	shift
-	$*
-	if [ $? -eq 0 ]; then
-		echo_success
-		echo
-		return 0
-	fi
-
-	echo_failure
-	echo
-	return 1
-}
-
-
-#
-# Start Oracle9i (database portion)
-#
-start_db()
-{
-	declare tmpfile
-	declare logfile
-	declare -i rv
-
-	tmpfile="$(mktemp /tmp/$SCRIPT-start.XXXXXX)"
-	logfile=@LOGDIR@/$SCRIPT-start.log
-
-	#
-	# Set up our sqlplus script.  Basically, we're trying to 
-	# capture output in the hopes that it's useful in the case
-	# that something doesn't work properly.
-	#
-	echo "startup" > $tmpfile
-	echo "quit" >> $tmpfile
-
-	sqlplus "/ as sysdba" < $tmpfile &> $logfile
-	rv=$?
-
-	rm -f $tmpfile
-
-	# Dump logfile to /var/log/messages
-	logger -f $logfile
-
-	if [ $rv -ne 0 ]; then
-		echo "ORACLE_HOME Incorrectly set?"
-		echo "See $logfile for more information."
-		return 1
-	fi
-
-	# 
-	# If we see:
-	# ORA-.....: failure, we failed
-	#
-
-	rm -f $tmpfile
-	grep -q "^ORA-" $logfile
-	if [ $? -eq 0 ]; then
-		echo "ORACLE_SID Incorrectly set?"
-		rm -f $tmpfile
-		echo "See $logfile for more information."
-		return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Stop Oracle9i (database portion)
-#
-stop_db()
-{
-	declare tmpfile
-	declare logfile
-	declare -i rv
-
-	tmpfile="$(mktemp /tmp/$SCRIPT-stop.XXXXXX)"
-	logfile=@LOGDIR@/$SCRIPT-stop.log
-
-	# Setup for Stop ...
-	echo "shutdown abort" > $tmpfile
-	echo "quit" >> $tmpfile
-
-	sqlplus "/ as sysdba" < $tmpfile &> $logfile
-	rv=$?
-
-	rm -f $tmpfile
-
-	# Dump logfile to /var/log/messages
-	logger -f $logfile
-
-	if [ $rv -ne 0 ]; then
-		echo "ORACLE_HOME Incorrectly set?"
-		echo "See $logfile for more information."
-		return 1
-	fi
-
-	# 
-	# If we see 'failure' in the log, we're done.
-	#
-	rm -f $tmpfile
-	grep -q "^ORA-" $logfile
-	if [ $? -eq 0 ]; then
-		echo_failure
-		echo
-		echo "Possible reason: ORACLE_SID Incorrectly set."
-		echo "See $logfile for more information."
-		return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Destroy any remaining processes with refs to $ORACLE_HOME
-#
-force_cleanup()
-{
-	declare pids
-	declare pid
-
-	# Patch from Shane Bradley to fix 471266
-	pids=`ps ax | grep $ORACLE_HOME | grep "ora_.*_${ORACLE_SID}" | grep -v grep | awk '{print $1}'`
-
-	logger -t $SCRIPT "<err> Not all Oracle processes exited cleanly, killing"
-	
-	for pid in $pids; do
-		kill -9 $pid
-		if [ $? -eq 0 ]; then
-			logger -t $SCRIPT "Killed $pid"
-		fi
-	done
-
-	return 0
-}
-
-
-
-#
-# Wait for oracle processes to exit.  Time out after 60 seconds
-#
-exit_idle()
-{
-	declare -i n=0
-	while ps ax | grep $ORACLE_HOME | grep -q -v grep; do
-		if [ $n -ge 90 ]; then
-			force_cleanup
-			return 0
-		fi
-		sleep 1
-		((n++))
-	done
-	return 0
-}
-
-
-#
-# Get database background process status.  Restart it if it failed and
-# we have seen the lock file.
-#
-get_db_status()
-{
-	declare -i subsys_lock=$1
-	declare -i i=0
-	declare -i rv=0
-	declare ora_procname
-
-	for procname in $DB_PROCNAMES ; do
-
-		ora_procname="ora_${procname}_${ORACLE_SID}"
-		
-		status $ora_procname
-		if [ $? -eq 0 ] ; then
-			# This one's okay; go to the next one.
-			continue
-		fi
-
-		#
-		# We're not supposed to be running, and we are,
-		# in fact, not running...
-		# XXX only works when monitoring one db process; consider
-		# extending in future.
-		#
-		if [ $subsys_lock -ne 0 ]; then
-			return 3
-		fi
-
-		for (( i=$RESTART_RETRIES ; i; i-- )) ; do
-			# this db process is down - stop and
-			# (re)start all ora_XXXX_$ORACLE_SID processes
-			logger -t $SCRIPT "Restarting Oracle Database..."
-			stop_db
-			if [ $? != 0 ] ; then
-				# stop failed - return 1
-				return 1
-			fi
-
-			start_db
-			if [ $? == 0 ] ; then
-				# ora_XXXX_$ORACLE_SID processes started
-				# successfully, so break out of the
-				# stop/start # 'for' loop
-				break
-			fi
-		done
-
-		if [ $i -eq 0 ]; then
-			# stop/start's failed - return 1 (failure)
-			return 1
-		fi
-	done
-	return 0
-}
-
-
-#
-# Get the status of the Oracle listener process
-#
-get_lsnr_status() 
-{
-	declare -i subsys_lock=$1
-	declare -i rv
-
-	status $LSNR_PROCNAME
-	rv=$?
-	if [ $rv == 0 ] ; then
-		return 0 # Listener is running fine
-	fi
-
-	#
-	# We're not supposed to be running, and we are,
-	# in fact, not running.  Return 3
-	#
-	if [ $subsys_lock -ne 0 ]; then
-		return 3
-	fi
-
-	#
-	# Listener is NOT running (but should be) - try to restart
-	#
-	for (( i=$RESTART_RETRIES ; i; i-- )) ; do
-
-		action "Restarting Oracle listener:" lsnrctl start \
-					$ORACLE_LISTENER
-		lsnrctl status $ORACLE_LISTENER >& /dev/null
-		if [ $? == 0 ] ; then
-			break # Listener was (re)started and is running fine
-		fi
-	done
-
-	if [ $i -eq 0 ]; then
-		# stop/start's failed - return 1 (failure)
-		return 1
-	fi
-
-	status $LSNR_PROCNAME
-	if [ $? != 0 ] ; then
-		return 1 # Problem restarting the Listener
-	fi
-	return 0 # Success restarting the Listener
-}
-
-
-#
-# usage: get_opmn_proc_status <ias-component> [process-type]
-#
-# Get the status of a specific OPMN-managed process.  If process-type
-# is not specified, assume the process-type is the same as the ias-component.
-# If the lock-file exists (or no lock file is specified), try to restart
-# the given process-type if it is not running.
-#
-get_opmn_proc_status()
-{
-	declare comp=$1
-	declare opmntype=$2
-	declare type_pretty
-	declare _pid _status
-	
-	[ -n "$comp" ] || return 1
-	if [ -z "$opmntype" ]; then
-		opmntype=$comp
-	else
-		type_pretty=" [$opmntype]"
-	fi
-
-	for (( i=$RESTART_RETRIES ; i; i-- )) ; do
-
-		_status=`opmnctl status | grep "^$comp " | grep " $opmntype " | cut -d '|' -f3,4 | sed -e 's/ //g' -e 's/|/ /g'`
-
-		_pid=`echo $_status | cut -f1 -d' '`
-		_status=`echo $_status | cut -f2 -d' '`
-		if [ "${_status}" == "Alive" ] || [ "${_status}" == "Init" ]; then
-			if [ $i -lt $RESTART_RETRIES ] ; then
-				echo "  $comp$type_pretty restarted"
-			fi
-			echo "  $comp$type_pretty (pid $_pid) is running..."
-			break
-		else
-			echo "  $comp$type_pretty is stopped"
-
-			#
-			# Try to restart it, but don't worry if we fail.  OPMN
-			# is supposed to handle restarting these anyway.
-			#
-			# If it's running and you tell OPMN to "start" it,
-			# you will get an error.
-			#
-			# If it's NOT running and you tell OPMN to "restart"
-			# it, you will also get an error.
-			#
-			opmnctl startproc process-type=$opmntype &> /dev/null
-		fi
-	done
-
-	if [ $i -eq 0 ]; then
-		# restarts failed - return 1 (failure)
-		return 1
-	fi
-
-	return 0
-}
-
-
-#
-# Get the status of the OPMN-managed processes.
-#
-get_opmn_status()
-{
-	declare -i subsys_lock=$1
-	declare -i ct_errors=0
-
-	opmnctl status &> /dev/null
-	if [ $? -eq 2 ]; then
-		#
-		# OPMN not running??
-		#
-		echo "opmn is stopped"
-
-		if [ $subsys_lock -eq 0 ]; then
-			#
-			# Don't handle full opmn-restart. XXX
-			#
-			return 1
-		fi
-
-		# That's okay, it's not supposed to be!
-		return 3
-	fi
-
-	#
-	# Print out the PIDs for everyone.
-	#
-	echo "opmn is running..."
-	echo "opmn components:"
-
-	#
-	# Check the OPMN-managed processes
-	#
-	get_opmn_proc_status OID || ((ct_errors++))
-	get_opmn_proc_status HTTP_Server || ((ct_errors++))
-	get_opmn_proc_status OC4J OC4J_SECURITY || ((ct_errors++))
-
-	#
-	# One or more OPMN-managed processes failed and could not be
-	# restarted.
-	#
-	if [ $ct_errors -ne 0 ]; then
-		return 1
-	fi
-	return 0
-}
-
-
-#
-# Helps us keep a running status so we know what our ultimate return
-# code will be.  Returns 1 if the $1 and $2 are not equivalent, otherwise
-# returns $1.  The return code is meant to be the next $1 when this is
-# called, so, for example:
-#
-# update_status 0   <-- returns 0
-# update_status $? 0 <-- returns 0
-# update_status $? 3 <-- returns 1 (values different - error condition)
-# update_status $? 1 <-- returns 1 (same, but happen to be error state!)
-#
-# update_status 3
-# update_status $? 3 <-- returns 3
-#
-# (and so forth...)
-#
-update_status()
-{
-	declare -i old_status=$1
-	declare -i new_status=$2
-
-	if [ -z "$2" ]; then
-		return $old_status
-	fi
-
-	if [ $old_status -ne $new_status ]; then
-		return 1
-	fi
-
-	return $old_status
-}
-
-
-#
-# Print an error message to the user and exit.
-#
-oops()
-{
-	echo "Please configure this script ($0) to"
-	echo "match your installation."
-	echo 
-	echo "    $1 failed validation checks."
-	exit 1
-}
-
-
-#
-# Do some validation on the user-configurable stuff at the beginning of the
-# script.
-#
-validation_checks()
-{
-	#
-	# If the oracle user doesn't exist, we're done.
-	#
-	[ -n "$ORACLE_USER" ] || oops "ORACLE_USER"
-	id -u $ORACLE_USER > /dev/null || oops "ORACLE_USER"
-	id -g $ORACLE_USER > /dev/null || oops "ORACLE_USER"
-
-	#
-	# If the oracle home isn't a directory, we're done
-	#
-	[ -n "$ORACLE_HOME" ] || oops ORACLE_HOME
-	#[ -d "$ORACLE_HOME" ] || oops ORACLE_HOME
-
-	#
-	# If the oracle SID is NULL, we're done
-	#
-	[ -n "$ORACLE_SID" ] || oops ORACLE_SID
-
-	#
-	# If we don't know the type, we're done
-	#
-	if [ "$ORACLE_TYPE" = "base" ]; then
-		# Other names for base
-		ORACLE_TYPE="base"
-	elif [ "$ORACLE_TYPE" = "10g" ] || [ "$ORACLE_TYPE" = "base-em" ]; then
-		ORACLE_TYPE="base-em"
-	elif [ "$ORACLE_TYPE" = "10g-ias" ] || [ "$ORACLE_TYPE" = "ias" ]; then
-		ORACLE_TYPE="ias"
-	else
-		oops ORACLE_TYPE
-	fi
-
-	#
-	# If the hostname is zero-length, fix it
-	#
-	[ -n "$ORACLE_HOSTNAME" ] || ORACLE_HOSTNAME=`hostname`
-
-	#
-	# Super user? Automatically change UID and exec as oracle user.
-	# Oracle needs to be run as the Oracle user, not root!
-	#
-	if [ "`id -u`" = "0" ]; then
-		echo "Restarting $0 as $ORACLE_USER."
-		#
-		# Breaks on RHEL5 
-		# exec sudo -u $ORACLE_USER $0 $*
-		#
-		su $ORACLE_USER -c "$0 $*"
-		exit $?
-	fi
-
-	#
-	# If we're not root and not the Oracle user, we're done.
-	#
-	[ "`id -u`" = "`id -u $ORACLE_USER`" ] || exit 1
-	[ "`id -g`" = "`id -g $ORACLE_USER`" ] || exit 1
-
-	#
-	# Go home.
-	#
-	cd $ORACLE_HOME
-
-	return 0
-}
-
-
-#
-# Start Oracle9i Application Server Infrastructure
-#
-start_oracle()
-{
-	faction "Starting Oracle Database:" start_db || return 1
-	action "Starting Oracle Listener:" lsnrctl start $ORACLE_LISTENER || return 1
-
-	if [ "$ORACLE_TYPE" = "base-em" ]; then
-		action "Starting iSQL*Plus:" isqlplusctl start || return 1
-		action "Starting Oracle EM DB Console:" emctl start dbconsole || return 1
-	elif [ "$ORACLE_TYPE" = "ias" ]; then
-		action "Starting Oracle EM:" emctl start em || return 1
-		action "Starting iAS Infrastructure:" opmnctl startall || return 1
-	fi
-
-	if [ -n "$LOCKFILE" ]; then
-		touch $LOCKFILE
-	fi
-	return 0
-}
-
-
-#
-# Stop Oracle9i Application Server Infrastructure
-#
-stop_oracle()
-{
-	if ! [ -e "$ORACLE_HOME/bin/lsnrctl" ]; then
-		echo "Oracle Listener Control is not available"
-		echo "    ($ORACLE_HOME not mounted?)"
-		return 0
-	fi
-
-	if [ "$ORACLE_TYPE" = "base-em" ]; then
-		action "Stopping Oracle EM DB Console:" emctl stop dbconsole || return 1
-		action "Stopping iSQL*Plus:" isqlplusctl stop || return 1
-	elif [ "$ORACLE_TYPE" = "ias" ]; then
-		action "Stopping iAS Infrastructure:" opmnctl stopall || return 1
-		action "Stopping Oracle EM:" emctl stop em || return 1
-	fi
-
-	faction "Stopping Oracle Database:" stop_db || return 1
-	action "Stopping Oracle Listener:" lsnrctl stop $ORACLE_LISTENER
-	faction "Waiting for all Oracle processes to exit:" exit_idle 
-
-	if [ $? -ne 0 ]; then
-		echo "WARNING: Not all Oracle processes exited cleanly"
-	fi
-
-	if [ -n "$LOCKFILE" ]; then
-		rm -f $LOCKFILE
-	fi
-	return 0
-}
-
-
-#
-# Find and display the status of iAS infrastructure.
-#
-# This has three parts:
-# (1) Oracle database itself
-# (2) Oracle listener process
-# (3) OPMN and OPMN-managed processes
-#
-# - If all are (cleanly) down, we return 3.  In order for this to happen,
-# $LOCKFILE must not exist.  In this case, we try and restart certain parts
-# of the service - as this may be running in a clustered environment.
-#
-# - If some but not all are running (and, if $LOCKFILE exists, we could not
-# restart the failed portions), we return 1 (ERROR)
-#
-# - If all are running, return 0.  In the "all-running" case, we recreate
-# $LOCKFILE if it does not exist.
-#
-status_oracle()
-{
-	declare -i subsys_lock=1
-	declare -i last 
-
-	#
-	# Check for lock file.  Crude and rudimentary, but it works
-	#
-	if [ -z "$LOCKFILE" ] || [ -f $LOCKFILE ]; then
-		subsys_lock=0 
-	fi
-
-	# Check database status
-	get_db_status $subsys_lock
-	update_status $? # Start
-	last=$?
-
-	# Check & report listener status
-	get_lsnr_status $subsys_lock
-	update_status $? $last
-	last=$?
-	
-	if [ "$ORACLE_TYPE" = "base-em" ]; then
-		# XXX Add isqlplus status check?!
-		emctl status dbconsole 2>&1 | grep "is running"
-		update_status $? $last
-		last=$?
-	elif [ "$ORACLE_TYPE" = "ias" ]; then
-		# Check & report opmn / opmn-managed process status
-		get_opmn_status $subsys_lock
-		update_status $? $last
-		last=$?
-	fi
-
-	#
-	# No lock file, but everything's running.  Put the lock
-	# file back. XXX - this kosher?
-	#
-	if [ $last -eq 0 ] && [ $subsys_lock -ne 0 ]; then
-		touch $LOCKFILE
-	fi
-
-	return $last
-}
-
-
-########################
-# Do some real work... #
-########################
-if [ "$1" = "meta-data" ]; then
-	meta_data
-	exit 0
-fi
-
-validation_checks $*
-
-case $1 in
-	start)
-		start_oracle
-		exit $?
-		;;
-	stop)
-		stop_oracle
-		exit $?
-		;;
-	status|monitor)
-		status_oracle
-		exit $?
-		;;
-	restart)
-		$0 stop || exit $?
-		$0 start || exit $?
-		exit 0
-		;;
-	*)
-		echo "usage: $SCRIPT {start|stop|status|restart|meta-data}"
-		exit 1
-		;;
-esac
-exit 0
diff --git a/rgmanager/src/resources/postgres-8.metadata b/rgmanager/src/resources/postgres-8.metadata
deleted file mode 100644
index ad3f84e..0000000
--- a/rgmanager/src/resources/postgres-8.metadata
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="postgres-8">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of PostgreSQL server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a PostgreSQL server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/var/lib/pgsql/data/postgresql.conf"/>
-        </parameter>
-
-	<parameter name="postmaster_user">
-		<longdesc lang="en">
-			User who runs the database server because it can't be
-			run by root.
-		</longdesc>
-		<shortdesc lang="en">
-			User who runs the database server
-		</shortdesc>
-		<content type="string" default="postgres" />
-	</parameter>
-
-	<parameter name="postmaster_options">
-		<longdesc lang="en">
-			Other command-line options for postmaster
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for postmaster
-		</shortdesc>
-		<content type="string" default="-D /var/lib/pgsql/data"/>
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/postgres-8.sh b/rgmanager/src/resources/postgres-8.sh
deleted file mode 100644
index b0b59c7..0000000
--- a/rgmanager/src/resources/postgres-8.sh
+++ /dev/null
@@ -1,206 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare PSQL_POSTMASTER="/usr/bin/postmaster"
-declare PSQL_pid_file="`generate_name_for_pid_file`"
-declare PSQL_conf_dir="`generate_name_for_conf_dir`"
-declare PSQL_gen_config_file="$PSQL_conf_dir/postgresql.conf"
-declare PSQL_kill_timeout="5"
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_postmaster_user" ]; then
-		clog_servicer_verify $CLOG_FAILED "Invalid User"
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_addressess="$3"
-	
-	declare ip_comma="";
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	declare x=1
-	for i in $ip_addressess; do
-		i=`echo $i | sed -e 's/\/.*$//'`
-		if [ $x -eq 1 ]; then
-			x=0
-			ip_comma=$i
-		else
-			ip_comma=$ip_comma,$i
-		fi 
-	done
-
-	generate_configTemplate "$generated_file" "$1"
-	echo "external_pid_file = '$PSQL_pid_file'" >> "$generated_file"
-	echo "listen_addresses = '$ip_comma'" >> "$generated_file"
-
-	echo >> "$generated_file"	
-	sed 's/^[[:space:]]*external_pid_file/### external_pid_file/i;s/^[[:space:]]*listen_addresses/### listen_addresses/i' < "$original_file" >> "$generated_file"
-	
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	declare pguser_group
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$PSQL_conf_dir"
-	check_pid_file "$PSQL_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$PSQL_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	#
-	# Create an empty PID file for the postgres user and
-	# change it to be owned by the postgres user so that
-	# postmaster doesn't complain.
-	#
-	pguser_group=`groups $OCF_RESKEY_postmaster_user | cut -f1 -d ' '`
-	touch $PSQL_pid_file
-	chown $OCF_RESKEY_postmaster_user.$pguser_group $PSQL_pid_file
-
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	generate_config_file "$OCF_RESKEY_config_file" "$PSQL_gen_config_file" "$ip_addresses"
-
-	su - "$OCF_RESKEY_postmaster_user" -c "$PSQL_POSTMASTER -c config_file=\"$PSQL_gen_config_file\" \
-		$OCF_RESKEY_postmaster_options" &> /dev/null &
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_start $CLOG_SUCCEED
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic_sigkill "$PSQL_pid_file" "$OCF_RESKEY_shutdown_wait" "$PSQL_kill_timeout"
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$PSQL_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$PSQL_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/ra-api-1-modified.dtd b/rgmanager/src/resources/ra-api-1-modified.dtd
deleted file mode 100644
index 9c42d23..0000000
--- a/rgmanager/src/resources/ra-api-1-modified.dtd
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-
-<!-- This is based on the RA-API-1.0 DTD from:
-     http://www.opencf.org/cgi-bin/viewcvs.cgi/specs/ra/ra-api-1.dtd
-
-     There are additions for rgmanager.  These additions should be
-     ignored by other RMs.
- -->
-
-<!ELEMENT resource-agent (version,longdesc,shortdesc,parameters,actions,special*) >
-<!ATTLIST resource-agent
-	name	CDATA	#REQUIRED
-	version CDATA   #IMPLIED>
-
-<!ELEMENT version (#PCDATA)>
-
-<!ELEMENT parameters (parameter*)>
-
-<!ELEMENT actions (action*)>
-
-<!-- Primary and required are for rgmanager use. -->
-<!ELEMENT parameter (longdesc+,shortdesc+,content)>
-<!ATTLIST parameter
-	name	CDATA	#REQUIRED
-	primary (1|0)   "0"
-	required (1|0)	"0"
-	inherit CDATA	""
-	unique	(1|0)	"0"
-	reconfig (1|0)  "0">
-
-<!ELEMENT longdesc ANY>
-<!ATTLIST longdesc
-	lang	NMTOKEN	#IMPLIED>
-
-<!ELEMENT shortdesc ANY>
-<!ATTLIST shortdesc
-	lang	NMTOKEN	#IMPLIED>
-
-<!ELEMENT content EMPTY>
-<!ATTLIST content
-	type	(string|integer|boolean)	#REQUIRED
-	default CDATA	#IMPLIED>
-
-<!ELEMENT action EMPTY>
-<!ATTLIST action
-	name	(start|stop|recover|status|reconfig|monitor|reload|meta-data|validate-all|migrate|methods)	#REQUIRED
-	timeout		CDATA	#REQUIRED
-	interval 	CDATA	#IMPLIED
-	start-delay 	CDATA	#IMPLIED
-	depth		CDATA	#IMPLIED>
-
-<!-- Special tag list for rgmanager -->
-<!ELEMENT special (attributes*, child*)>
-<!ATTLIST special
-	tag	CDATA	#REQUIRED>
-
-<!ELEMENT attributes EMPTY>
-<!ATTLIST attributes
-	maxinstances CDATA "0"
-	init_on_add CDATA "0"
-	destroy_on_delete CDATA "0">
-
-<!ELEMENT child EMPTY>
-<!ATTLIST child
-	type CDATA #REQUIRED
-	forbid (1|0) "0"
-	start CDATA "100"
-	stop CDATA "0">
diff --git a/rgmanager/src/resources/ra2man.xsl b/rgmanager/src/resources/ra2man.xsl
deleted file mode 100644
index 095a7b3..0000000
--- a/rgmanager/src/resources/ra2man.xsl
+++ /dev/null
@@ -1,158 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method="text" indent="no"/>
-
-<xsl:template match="parameter">
-.TP
-.B <xsl:value-of select="@name"/><xsl:text>
-</xsl:text>
-<xsl:value-of select="normalize-space(longdesc)"/><xsl:text>
-</xsl:text>
-<xsl:if test="@primary = 1">This is the defining attribute for the <b><xsl:value-of select="/resource-agent/@name"/></b> resource type, and will be shown in logs.
-</xsl:if>
-<xsl:if test="@unique = 1 or @primary = 1">No other instances of the 
-.B <xsl:value-of select="/resource-agent/@name"/>
-resource may have the same value for the 
-.B <xsl:value-of select="@name"/>
-parameter.
-</xsl:if>
-<xsl:if test="@required = 1 or @primary = 1">This parameter is required; the resource manager will ignore specification of a resource without this parameter.</xsl:if>
-<xsl:if test="@reconfig = 1">You may safely change this attribute on the fly; doing so will not cause a restart of the resource or its children.
-</xsl:if>
-Content: <xsl:value-of select="content/@type"/><xsl:text>
-</xsl:text>
-<xsl:if test="content/@default">Default Value: <xsl:value-of select="content/@default"/>
-</xsl:if>
-</xsl:template>
-
-<xsl:template match="action">
-.TP
-\fB<xsl:value-of select="@name"/>\fp<xsl:if test="@timeout"> (timeout: <xsl:value-of select="@timeout"/>) </xsl:if>
-<xsl:choose>
-<xsl:when test="@name = 'start'">
-This starts the resource.
-</xsl:when>
-<xsl:when test="@name = 'stop'">
-This stops the resource.
-</xsl:when>
-<xsl:when test="@name = 'monitor'">
-<xsl:if test="@depth">
-Depth <xsl:value-of select="@depth"/>.
-</xsl:if>
-This checks the status of the resource.  This is specified in the OCF Resource Agent API, but not LSB compliant.  This is synonymous with
-.B status
-on some resource managers.
-</xsl:when>
-<xsl:when test="@name = 'validate-all'">
-Given (minimally) all required parameters to start or check the status of the resource, validate that those parameters are correct as much as possible.
-</xsl:when>
-<xsl:when test="@name = 'meta-data'">
-Display the XML metadata describing this resource.
-</xsl:when>
-<xsl:when test="@name = 'reload'">Reconfigure the resource in-place with the new given parameters.
-</xsl:when>
-<xsl:when test="@name = 'recover'">
-Attempt to recover the resource in-place without affecting dependencies.  If this fails, the resource manager will try more forceful recovery (such as stop-start).
-</xsl:when>
-<!-- known non-OCF stuff -->
-<xsl:when test="@name = 'status'">
-<xsl:if test="@depth">Depth <xsl:value-of select="@depth"/>.
-</xsl:if>
-This checks the status of the resource.  This is LSB compliant, but not specified by the OCF Resource Agent API.  This is synonymous with
-.B monitor
-on some resource managers.
-</xsl:when>
-<xsl:when test="@name = 'reconfig'">
-Reconfigure the resource in-place with the new given parameters.
-</xsl:when>
-<xsl:when test="@name = 'verify-all'">
-Given (minimally) all required parameters to start or check the status of the resource, validate that those parameters are correct as much as possible.  This is a misinterpretation of the 
-.B validate-all
-action, and should be fixed.  Please report a bug.
-</xsl:when>
-<xsl:when test="@name = 'promote'">
-If this resource was the slave instance of the
-resource, promote it to master status.
-</xsl:when>
-<xsl:when test="@name = 'demote'">
-If this resource was the master instance of the
-resource, demote it to slave status.
-</xsl:when>
-<xsl:when test="@name = 'migrate'">
-Migrate this resource to another node in the cluster.
-</xsl:when>
-<!-- Ehhh -->
-<xsl:otherwise>
-The operational behavior of this is not known.
-</xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-
-<xsl:template match="child">
-.PP
-<xsl:value-of select="@type"/> -
-Started at level <xsl:value-of select="@start"/>.
-Stopped at level <xsl:value-of select="@stop"/>.
-</xsl:template>
-<xsl:template match="/resource-agent">.TH RESOURCE_AGENT 8 2009-01-20 "<xsl:value-of select="@name"/> (Resource Agent)"
-.SH
-<xsl:value-of select="@name"/>
-Cluster Resource Agent
-
-.SH DESCRIPTION
-<xsl:value-of select="normalize-space(longdesc)"/>
-
-.SH PARAMETERS
-<xsl:apply-templates select="parameters"/>
-
-.SH RGMANAGER INTERNAL PARAMETERS
-.TP
-.B __enforce_timeouts
-If set to 1, an operation exceeding the defined timeout will be considered
-a failure of that operation.  Note that fail-to-stop is critical, and causes
-a service to enter the failed state.
-
-.TP
-.B __independent_subtree
-If set to 1, failure of a status operation of this resource or any of its
-children will be considered non-fatal unless a restart of this resource and
-all of its children also fails.
-
-.SH ACTIONS
-<xsl:apply-templates select="actions"/>
-
-.SH RGMANAGER NOTES
-<xsl:if test="special/@tag = 'rgmanager'">
-<xsl:if test="special/attributes/@maxinstances">
-.PP
-An instatnce of this resource defined in the
-.B &lt;resources&gt;
-section of
-.B cluster.conf
-can be referenced in the resource
-tree at most <xsl:value-of select="special/attributes/@maxinstances"/>
-time(s).  All subsequent references to this resource will be ignored.
-</xsl:if>
-<xsl:if test="special/attributes/@root">
-.PP
-This is the root resource class.  Other resource 
-types must be attached as children to this resource
-class.
-</xsl:if>
-<xsl:if test="special/child/@type">
-.PP
-Known Child Types:
-<xsl:apply-templates select="special"/>
-</xsl:if>
-</xsl:if>
-.SH REFERENCES
-.PP
-http://www.opencf.org/cgi-bin/viewcvs.cgi/specs/ra/resource-agent-api.txt?rev=HEAD - The Open Cluster Framework Resource Agent Application Programming Interface draft version 1.0
-
-.PP
-http://www.linux-foundation.org/spec/refspecs/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html - Linux Standards Base v3.1.0 - Init Script Actions
-
-.PP
-http://sources.redhat.com/cluster/wiki/RGManager - Linux-cluster Resource Group Manager information
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/rgmanager/src/resources/ra2ref.xsl b/rgmanager/src/resources/ra2ref.xsl
deleted file mode 100644
index 6e61073..0000000
--- a/rgmanager/src/resources/ra2ref.xsl
+++ /dev/null
@@ -1,10 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method="text" indent="yes"/>
-<xsl:template name="capitalize">
-	<xsl:param name="value"/>
-	<xsl:variable name="normalized" select="translate($value, '_abcdefghijklmnopqrstuvwrxyz', '-ABCDEFGHIJKLMNOPQRSTUVWRXYZ')"/>
-	<xsl:value-of select="$normalized"/>
-</xsl:template>
-<xsl:template match="/resource-agent">
-        &lt;ref name="<xsl:call-template name="capitalize"><xsl:with-param name="value" select="@name"/></xsl:call-template>"/&gt;</xsl:template>
-</xsl:stylesheet>
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
deleted file mode 100644
index 11782d7..0000000
--- a/rgmanager/src/resources/ra2rng.xsl
+++ /dev/null
@@ -1,54 +0,0 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method="text" indent="yes"/>
-<xsl:template name="capitalize">
-	<xsl:param name="value"/>
-	<xsl:variable name="normalized" select="translate($value, '_abcdefghijklmnopqrstuvwrxyz', '-ABCDEFGHIJKLMNOPQRSTUVWRXYZ')"/>
-	<xsl:value-of select="$normalized"/>
-</xsl:template>
-
-<xsl:template match="/resource-agent">
-  &lt;define name="<xsl:call-template name="capitalize"><xsl:with-param name="value" select="@name"/></xsl:call-template>"&gt;
-    &lt;element name="<xsl:value-of select="@name"/>" rha:description="<xsl:value-of select="normalize-space(shortdesc)"/>"&gt;
-      &lt;choice&gt;
-      &lt;group&gt;
-        &lt;!-- rgmanager specific stuff --&gt;
-        &lt;attribute name="ref" rha:description="Reference to existing <xsl:value-of select="@name"/> resource in the resources section."/&gt;
-      &lt;/group&gt;
-      &lt;group&gt;<xsl:for-each select="parameters/parameter">
-		<xsl:choose>
-			<xsl:when test="@required = 1 or @primary = 1">
-        &lt;attribute name="<xsl:value-of select="@name"/>" rha:description="<xsl:value-of select="normalize-space(shortdesc)"/>"/&gt;</xsl:when>
-			<xsl:otherwise>
-        &lt;optional&gt;
-          &lt;attribute name="<xsl:value-of select="@name"/>" rha:description="<xsl:value-of select="normalize-space(shortdesc)"/>"/&gt;
-        &lt;/optional&gt;</xsl:otherwise>
-		</xsl:choose>
-	</xsl:for-each>
-      &lt;/group&gt;
-      &lt;/choice&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree."/&gt;
-      &lt;/optional&gt;
-      &lt;optional&gt;
-        &lt;ref name="CHILDREN"/&gt;
-      &lt;/optional&gt;
-    &lt;/element&gt;
-  &lt;/define&gt;
-
-</xsl:template>
-</xsl:stylesheet>
diff --git a/rgmanager/src/resources/resources.rng.head b/rgmanager/src/resources/resources.rng.head
deleted file mode 100644
index 750c6d3..0000000
--- a/rgmanager/src/resources/resources.rng.head
+++ /dev/null
@@ -1 +0,0 @@
-<!-- Autogenerated.  Paste in to cluster.ng in the 'resources' section -->
diff --git a/rgmanager/src/resources/resources.rng.mid b/rgmanager/src/resources/resources.rng.mid
deleted file mode 100644
index cc2dff3..0000000
--- a/rgmanager/src/resources/resources.rng.mid
+++ /dev/null
@@ -1,3 +0,0 @@
-  <define name="CHILDREN">
-    <zeroOrMore>
-     <choice>
diff --git a/rgmanager/src/resources/resources.rng.tail b/rgmanager/src/resources/resources.rng.tail
deleted file mode 100644
index 5cbcc9d..0000000
--- a/rgmanager/src/resources/resources.rng.tail
+++ /dev/null
@@ -1,24 +0,0 @@
-
-      <ref name="RESOURCEACTION"/>
-     </choice>
-    </zeroOrMore>
-  </define>
-
-  <define name="RESOURCEACTION">
-   <zeroOrMore>
-    <element name="action" rha:description="Overrides resource action timings for a resource instance.">
-     <attribute name="name" rha:description="Name of resource action (start, stop, status, etc.)."/>
-     <optional>
-      <attribute name="depth" rha:description="Status check depth (resource agent dependent; * = all depths)."/>
-     </optional>
-     <optional>
-      <attribute name="interval" rha:description="Status check interval."/>
-     </optional>
-     <optional>
-      <attribute name="timeout" rha:description="Action timeout.  Meaningless unless __enforce_timeouts is set for this resource."/>
-     </optional>
-    </element>
-   </zeroOrMore>
-  </define>
-
-<!-- End autogenerated resources definitions -->
diff --git a/rgmanager/src/resources/samba.metadata b/rgmanager/src/resources/samba.metadata
deleted file mode 100644
index 1e03fcd..0000000
--- a/rgmanager/src/resources/samba.metadata
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="samba">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-    	Dynamic smbd/nmbd resource agent
-    </longdesc>
-    <shortdesc lang="en">
-    	Dynamic smbd/nmbd resource agent
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" primary="1">
-            <longdesc lang="en">
-                Samba Symbolic Name.
-            </longdesc>
-            <shortdesc lang="en">
-                Samba Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/samba/smb.conf"/>
-        </parameter>
-
-	<parameter name="smbd_options">
-		<longdesc lang="en">
-			Other command-line options for smbd
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for smbd
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="nmbd_options">
-		<longdesc lang="en">
-			Other command-line options for nmbd
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for nmbd
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this smb service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-        <action name="stop" timeout="0"/>
-
-	<!-- This is just a wrapper for LSB init scripts, so monitor
-	     and status can't have a timeout, nor do they do any extra
-	     work regardless of the depth -->
-        <action name="status" interval="30s" timeout="0"/>
-        <action name="monitor" interval="30s" timeout="0"/>
-
-        <action name="meta-data" timeout="0"/>
-        <action name="validate-all" timeout="0"/>
-    </actions>
-</resource-agent>
diff --git a/rgmanager/src/resources/samba.sh b/rgmanager/src/resources/samba.sh
deleted file mode 100644
index f7c134b..0000000
--- a/rgmanager/src/resources/samba.sh
+++ /dev/null
@@ -1,223 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare SAMBA_SMBD=/usr/sbin/smbd
-declare SAMBA_NMBD=/usr/sbin/nmbd
-declare SAMBA_pid_dir="`generate_name_for_pid_dir`"
-declare SAMBA_conf_dir="`generate_name_for_conf_dir`"
-declare SAMBA_smbd_pid_file="$SAMBA_pid_dir/smbd-smb.conf.pid"
-declare SAMBA_nmbd_pid_file="$SAMBA_pid_dir/nmbd-smb.conf.pid"
-declare SAMBA_gen_config_file="$SAMBA_conf_dir/smb.conf"
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_addresses="$3"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	generate_configTemplate "$generated_file" "$1"
-
-	echo "pid directory = \"$SAMBA_pid_dir\"" >> "$generated_file"
-	echo "interfaces = $ip_addresses" >> "$generated_file"
-	echo "bind interfaces only = Yes" >> "$generated_file"
-	echo "netbios name = ${OCF_RESKEY_name/ /_}" >> "$generated_file"
-	echo >> "$generated_file"	
-	sed 's/^[[:space:]]*pid directory/### pid directory/i;s/^[[:space:]]*interfaces/### interfaces/i;s/^[[:space:]]*bind interfaces only/### bind interfaces only/i;s/^[[:space:]]*netbios name/### netbios name/i' \
-	     < "$original_file" >> "$generated_file"
-	
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	mkdir -p "$SAMBA_pid_dir"
-	create_conf_directory "$SAMBA_conf_dir"
-	check_pid_file "$SAMBA_smbd_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$SAMBA_smbd_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	check_pid_file "$SAMBA_nmbd_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$SAMBA_nmbd_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	generate_config_file "$OCF_RESKEY_config_file" "$SAMBA_gen_config_file" "$ip_addresses"
-
-	$SAMBA_SMBD -D -s "$SAMBA_gen_config_file" $OCF_RESKEY_smbd_options
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	$SAMBA_NMBD -D -s "$SAMBA_gen_config_file" $OCF_RESKEY_nmbd_options	
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	 
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$SAMBA_smbd_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	stop_generic "$SAMBA_nmbd_pid_file"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ -e "$SAMBA_smbd_pid_file" ]; then
-		rm -f "$SAMBA_smbd_pid_file"
-	fi
-
-	if [ -e "$SAMBA_nmbd_pid_file" ]; then
-		rm -f "$SAMBA_nmbd_pid_file"
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$SAMBA_smbd_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$SAMBA_smbd_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	status_check_pid "$SAMBA_nmbd_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$SAMBA_nmbd_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/script.sh b/rgmanager/src/resources/script.sh
deleted file mode 100644
index 4129811..0000000
--- a/rgmanager/src/resources/script.sh
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/bash
-
-#
-# Script to handle a non-OCF script (e.g. a normal init-script)
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-. $(dirname $0)/ocf-shellfuncs
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="script">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        The script resource allows a standard LSB-compliant init script
-	to be used to start a clustered service.
-    </longdesc>
-    <shortdesc lang="en">
-        LSB-compliant init script as a clustered resource.
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" primary="1">
-            <longdesc lang="en">
-                Name
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="file" unique="1" required="1">
-            <longdesc lang="en">
-                Path to script
-            </longdesc>
-            <shortdesc lang="en">
-                Path to script
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name, in case the
-		script wants to know this information.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-        <action name="stop" timeout="0"/>
-
-	<!-- This is just a wrapper for LSB init scripts, so monitor
-	     and status can't have a timeout, nor do they do any extra
-	     work regardless of the depth -->
-        <action name="status" interval="30s" timeout="0"/>
-        <action name="monitor" interval="30s" timeout="0"/>
-
-        <action name="meta-data" timeout="0"/>
-        <action name="validate-all" timeout="0"/>
-    </actions>
-</resource-agent>
-EOT
-}
-
-case $1 in
-	meta-data)
-		meta_data
-		exit 0
-		;;
-	validate-all)
-		exit 0 # XXX XXX XXX
-		;;
-	*)
-		;;
-esac
-
-[ -n "${OCF_RESKEY_file}" ] || exit $OCF_ERR_ARGS      # Invalid Argument
-[ -f "${OCF_RESKEY_file}" ] || exit $OCF_ERR_INSTALLED # Program not installed
-[ -x "${OCF_RESKEY_file}" ] || exit $OCF_ERR_GENERIC   # Generic error
-
-# Don't need to catch return codes; this one will work.
-ocf_log info "Executing ${OCF_RESKEY_file} $1"
-${OCF_RESKEY_file} $1
-
-declare -i rv=$?
-if [ $rv -ne 0 ]; then
-	ocf_log err "script:$OCF_RESKEY_name: $1 of $OCF_RESKEY_file failed (returned $rv)"
-	exit $OCF_ERR_GENERIC
-fi
diff --git a/rgmanager/src/resources/service.sh b/rgmanager/src/resources/service.sh
deleted file mode 100644
index e37f518..0000000
--- a/rgmanager/src/resources/service.sh
+++ /dev/null
@@ -1,282 +0,0 @@
-#!/bin/bash
-
-#
-# Dummy OCF script for resource group
-#
-
-# Grab nfs lock tricks if available
-export NFS_TRICKS=1
-if [ -f "$(dirname $0)/svclib_nfslock" ]; then
-	. $(dirname $0)/svclib_nfslock
-	NFS_TRICKS=0
-fi
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="service">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines a collection of resources, known as a resource
-        group or cluster service.
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a service (resource group).
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" required="1" primary="1">
-            <longdesc lang="en">
-                This is the name of the resource group.
-            </longdesc>
-            <shortdesc lang="en">
-                Name.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-    
-        <parameter name="domain" reconfig="1">
-            <longdesc lang="en">
-                Failover domains define lists of cluster members
-                to try in the event that a resource group fails.
-            </longdesc>
-            <shortdesc lang="en">
-                Failover domain.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="autostart" reconfig="1">
-            <longdesc lang="en">
-	    	If set to yes, this resource group will automatically be started
-		after the cluster forms a quorum.  If set to no, this resource
-		group will start in the 'disabled' state after the cluster forms
-		a quorum.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Automatic start after quorum formation
-            </shortdesc>
-            <content type="boolean" default="1"/>
-        </parameter>
-
-        <parameter name="exclusive" reconfig="1">
-            <longdesc lang="en">
-	    	If set, this resource group will only relocate to
-		nodes which have no other resource groups running in the
-		event of a failure.  If no empty nodes are available,
-		this resource group will not be restarted after a failure.
-		Additionally, resource groups will not automatically
-		relocate to the node running this resource group.  This
-		option can be overridden by manual start and/or relocate
-		operations.
-            </longdesc>
-            <shortdesc lang="en">
-	        Exclusive service.
-            </shortdesc>
-            <content type="boolean" default="0"/>
-        </parameter>
-
-	<parameter name="nfslock">
-	    <longdesc lang="en">
-	    	Enable NFS lock workarounds.  When used with a compatible
-		HA-callout program like clunfslock, this could be used
-		to provide NFS lock failover, but at significant cost to
-		other services on the machine.  This requires a compatible
-		version of nfs-utils and manual configuration of rpc.statd;
-		see 'man rpc.statd' to see if your version supports
-		the -H parameter.
-	    </longdesc>
-	    <shortdesc lang="en">
-	        Enable NFS lock workarounds.
-	    </shortdesc>
-	    <content type="boolean" default="0"/>
-	</parameter>
-
-	<parameter name="nfs_client_cache">
-            <longdesc lang="en">
-	   	On systems with large numbers of exports, a performance
-		problem in the exportfs command can cause inordinately long
-		status check times for services with lots of mounted
-		NFS clients.  This occurs because exportfs does DNS queries
-		on all clients in the export list.
-
-		Setting this option to '1' will enable caching of the export
-		list returned from the exportfs command on a per-service
-		basis.  The cache will last for 30 seconds before expiring
-		instead of being generated each time an nfsclient resource
-		is called.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Enable exportfs list caching (performance).
-            </shortdesc>
-	    <content type="integer" default="0"/>
-	</parameter>
-
-                
-        <parameter name="recovery" reconfig="1">
-            <longdesc lang="en">
-	        This currently has three possible options: "restart" tries
-		to restart failed parts of this resource group locally before
-		attempting to relocate (default); "relocate" does not bother
-		trying to restart the service locally; "disable" disables
-		the resource group if any component fails.  Note that
-		any resource with a valid "recover" operation which can be
-		recovered without a restart will be.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Failure recovery policy (restart, relocate, or disable).
-            </shortdesc>
-            <content type="string" default="restart"/>
-        </parameter>
-
-        <parameter name="depend">
-            <longdesc lang="en">
-		Service dependency; will not start without the specified
-		service running.
-            </longdesc>
-            <shortdesc lang="en">
-		Top-level service this depends on, in service:name format.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="depend_mode">
-            <longdesc lang="en">
-		Service dependency mode.
-		hard - This service is stopped/started if its dependency
-		       is stopped/started
-		soft - This service only depends on the other service for
-		       initial startip.  If the other service stops, this
-		       service is not stopped.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Service dependency mode (soft or hard).
-            </shortdesc>
-            <content type="string" default="hard"/>
-        </parameter>
-
-        <parameter name="max_restarts">
-            <longdesc lang="en">
-	    	Maximum restarts for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Maximum restarts for this service.
-            </shortdesc>
-            <content type="string" default="0"/>
-        </parameter>
-
-        <parameter name="restart_expire_time">
-            <longdesc lang="en">
-	    	Restart expiration time.  A restart is forgotten
-		after this time.  When combined with the max_restarts
-		option, this lets administrators specify a threshold
-		for when to fail over services.  If max_restarts
-		is exceeded in this given expiration time, the service
-		is relocated instead of restarted again.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Restart expiration time; amount of time before a restart
-		is forgotten.
-            </shortdesc>
-            <content type="string" default="0"/>
-        </parameter>
-
-	<parameter name="priority">
-	    <longdesc lang="en">
-		Priority for the service.  In a failover scenario, this
-		indicates the ordering of the service (1 is processed
-		first, 2 is processed second, etc.).  This overrides the
-		order presented in cluster.conf.  This option only has
-		an effect if central processing within rgmanager is turned
-		on.
-	    </longdesc>
-	    <shortdesc lang="en">
-		Service priority.
-	    </shortdesc>
-	    <content type="integer" default="0"/>
-	</parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="5"/>
-        <action name="stop" timeout="5"/>
-	
-	<!-- No-ops.  Groups are abstract resource types. 
-        <action name="status" timeout="5" interval="1h"/>
-        <action name="monitor" timeout="5" interval="1h"/>
- -->
-
-        <action name="reconfig" timeout="5"/>
-        <action name="recover" timeout="5"/>
-        <action name="reload" timeout="5"/>
-        <action name="meta-data" timeout="5"/>
-        <action name="validate-all" timeout="5"/>
-    </actions>
-    
-    <special tag="rgmanager">
-        <attributes maxinstances="1"/>
-        <child type="lvm" start="1" stop="9"/>
-        <child type="fs" start="2" stop="8"/>
-        <child type="clusterfs" start="3" stop="7"/>
-        <child type="netfs" start="4" stop="6"/>
-	<child type="nfsexport" start="5" stop="5"/>
-
-	<child type="nfsclient" start="6" stop="4"/>
-
-        <child type="ip" start="7" stop="2"/>
-        <child type="smb" start="8" stop="3"/>
-        <child type="script" start="9" stop="1"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-#
-# A Resource group is abstract, but the OCF RA API doesn't allow for abstract
-# resources, so here it is.
-#
-case $1 in
-	start)
-		#
-		# XXX If this is set, we kill lockd.  If there is no
-		# child IP address, then clients will NOT get the reclaim
-		# notification.
-		#
-		if [ $NFS_TRICKS -eq 0 ]; then
-			if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
-	   		   [ "$OCF_RESKEY_nfslock" = "1" ]; then
-				pkill -KILL -x lockd
-			fi
-		fi
-		exit 0
-		;;
-	stop)
-		exit 0
-		;;
-	recover|restart)
-		exit 0
-		;;
-	status|monitor)
-		exit 0
-		;;
-	reload)
-		exit 0
-		;;
-	meta-data)
-		meta_data
-		exit 0
-		;;
-	validate-all)
-		exit 0
-		;;
-	reconfig)
-		exit 0
-		;;
-	*)
-		exit 0
-		;;
-esac
diff --git a/rgmanager/src/resources/smb.sh b/rgmanager/src/resources/smb.sh
deleted file mode 100644
index e62678b..0000000
--- a/rgmanager/src/resources/smb.sh
+++ /dev/null
@@ -1,677 +0,0 @@
-#!/bin/bash
-
-#
-# Script to manage a Samba file-sharing service component.
-# Unline NFS, this should be placed at the top level of a service
-# because it will try to gather information necessary to run the
-# smbd/nmbd daemons at run-time from the service structure.
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-#
-# Definitions!
-#
-declare SAMBA_CONFIG_DIR=/etc/samba
-declare SMBD_COMMAND=/usr/sbin/smbd
-declare NMBD_COMMAND=/usr/sbin/nmbd
-declare KILLALL_COMMAND=/usr/bin/killall
-declare SAMBA_PID_DIR=/var/run/samba
-declare SAMBA_LOCK_DIR=/var/cache/samba
-
-#
-# gross globals
-#
-declare -a ipkeys
-declare -a fskeys
-
-# Don't change please :)
-_FAIL=255
-
-. $(dirname $0)/ocf-shellfuncs
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="smb">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-    	Dynamic smbd/nmbd resource agent
-    </longdesc>
-    <shortdesc lang="en">
-    	Dynamic smbd/nmbd resource agent
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" unique="1" primary="1">
-            <longdesc lang="en">
-                Samba Symbolic Name.  This name will
-		correspond to /etc/samba/smb.conf.NAME
-            </longdesc>
-            <shortdesc lang="en">
-                Samba Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="workgroup">
-            <longdesc lang="en">
-	    	Workgroup name
-            </longdesc>
-            <shortdesc lang="en">
-	    	Workgroup name
-            </shortdesc>
-	    <content type="string" default="LINUXCLUSTER"/>
-        </parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this smb service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-        <action name="stop" timeout="0"/>
-
-	<!-- This is just a wrapper for LSB init scripts, so monitor
-	     and status can't have a timeout, nor do they do any extra
-	     work regardless of the depth -->
-        <action name="status" interval="30s" timeout="0"/>
-        <action name="monitor" interval="30s" timeout="0"/>
-
-        <action name="meta-data" timeout="0"/>
-        <action name="validate-all" timeout="0"/>
-    </actions>
-</resource-agent>
-EOT
-}
-
-
-#
-# Usage: ccs_get key
-#
-ccs_get()
-{
-	declare outp
-	declare key
-
-	[ -n "$1" ] || return $_FAIL
-
-	key="$*"
-
-	outp=$(ccs_tool query "$key" 2>&1)
-	if [ $? -ne 0 ]; then
-		if [ "$outp" = "${outp/No data available/}" ] || [ "$outp" = "${outp/Operation not permitted/}" ]; then
-			ocf_log err "$outp ($key)"
-			return $_FAIL
-		fi
-
-		# no real error, just no data available
-		return 0
-	fi
-
-	echo $outp
-
-	return 0
-}
-
-
-#
-# Build a list of service IP keys; traverse refs if necessary
-#
-get_service_ip_keys()
-{
-	declare svc=$1
-	declare -i x y=0
-	declare outp
-	declare key
-
-	#
-	# Find service-local IP keys
-	#
-	x=1
-	while : ; do
-		key="/cluster/rm/service[@name=\"$svc\"]/ip[$x]"
-
-		#
-		# Try direct method
-		#
-		outp=$(ccs_get "$key/@address")
-		if [ $? -ne 0 ]; then
-			return 1
-		fi
-
-		#
-		# Try by reference
-		#
-		if [ -z "$outp" ]; then
-			outp=$(ccs_get "$key/@ref")
-			if [ $? -ne 0 ]; then
-				return 1
-			fi
-			key="/cluster/rm/resources/ip[@address=\"$outp\"]"
-		fi
-
-		if [ -z "$outp" ]; then
-			break
-		fi
-
-		#ocf_log debug "IP $outp found @ $key"
-
-		ipkeys[$y]="$key"
-
-		((y++))
-		((x++))
-	done
-
-	ocf_log debug "$y IP addresses found for $svc/$OCF_RESKEY_name"
-
-	return 0
-}
-
-
-#
-# Build a list of service fs keys, traverse refs if necessary
-#
-get_service_fs_keys()
-{
-	declare svc=$1
-	declare -i x y=0
-	declare outp
-	declare key
-
-	#
-	# Find service-local IP keys
-	#
-	x=1
-	while : ; do
-		key="/cluster/rm/service[@name=\"$svc\"]/fs[$x]"
-
-		#
-		# Try direct method
-		#
-		outp=$(ccs_get "$key/@name")
-		if [ $? -ne 0 ]; then
-			return 1
-		fi
-
-		#
-		# Try by reference
-		#
-		if [ -z "$outp" ]; then
-			outp=$(ccs_get "$key/@ref")
-			if [ $? -ne 0 ]; then
-				return 1
-			fi
-			key="/cluster/rm/resources/fs[@name=\"$outp\"]"
-		fi
-
-		if [ -z "$outp" ]; then
-			break
-		fi
-
-		#ocf_log debug "filesystem $outp found @ $key"
-
-		fskeys[$y]="$key"
-
-		((y++))
-		((x++))
-	done
-
-	ocf_log debug "$y filesystems found for $svc/$OCF_RESKEY_name"
-
-	return 0
-}
-
-
-build_ip_list()
-{
-	declare ipaddrs ipaddr
-	declare -i x=0
-
-	while [ -n "${ipkeys[$x]}" ]; do
-		ipaddr=$(ccs_get "${ipkeys[$x]}/@address")
-		if [ -z "$ipaddr" ]; then
-			break
-		fi
-
-		ipaddrs="$ipaddrs $ipaddr"
-
-		((x++))
-	done
-
-	echo $ipaddrs
-}
-
-
-add_sha1()
-{
-	declare sha1line="# rgmanager-sha1 $(sha1sum "$1")"
-	echo $sha1line >> "$1"
-}
-
-
-verify_sha1()
-{
-	declare tmpfile="$(mktemp /tmp/smb-$OCF_RESKEY_name.tmp.XXXXXX)"
-	declare current exp
-
-	exp=$(grep "^# rgmanager-sha1.*$1" "$1" | head -1)
-	if [ -z "$exp" ]; then
-		# No sha1 line.  We're done.
-		ocf_log debug "No SHA1 info in $1"
-		return 1
-	fi
-
-	#
-	# Find expected sha1 and expected file name
-	#
-	exp=${exp/*sha1 /}
-	exp=${exp/ */}
-
-	grep -v "^# rgmanager-sha1" "$1" > "$tmpfile"
-	current=$(sha1sum "$tmpfile")
-	current=${current/ */}
-
-	rm -f "$tmpfile"
-
-	if [ "$current" = "$exp" ]; then
-		ocf_log debug "SHA1 sum matches for $1"
-		return 0
-	fi
-	ocf_log debug "SHA1 sum does not match for $1"
-	return 1
-}
-
-
-add_fs_entries()
-{
-	declare conf="$1"
-	declare sharename
-	declare sharepath key
-
-	declare -i x=0
-
-	while [ -n "${fskeys[$x]}" ]; do
-		key="${fskeys[$x]}/@name"
-
-		sharename=$(ccs_get "$key")
-		if [ -z "$sharename" ]; then
-			break
-		fi
-
-		key="${fskeys[$x]}/@mountpoint"
-		sharepath=$(ccs_get "$key")
-		if [ -z "$sharepath" ]; then
-			break
-		fi
-
-		cat >> "$conf" <<EODEV
-[$sharename]
-	comment = Auto-generated $sharename share
-	# Hide the secret cluster files
-	veto files = /.clumanager/.rgmanager/
-	browsable = yes
-	writable = no
-	public = yes
-	path = $sharepath
-
-EODEV
-
-		((x++))
-	done
-}
-
-
-#
-# Generate the samba configuration if neede for this service.
-#
-gen_smb_conf()
-{
-	declare conf="$1"
-	declare lvl="debug"
-
-	if [ -f "$conf" ]; then
-		verify_sha1 "$conf"
-		if [ $? -ne 0 ]; then
-			ocf_log debug "Config file changed; skipping"
-			return 0
-		fi
-	else
-		lvl="info"
-	fi
-
-	ocf_log $lvl "Creating $conf"
-
-	get_service_ip_keys "$OCF_RESKEY_service_name"
-	get_service_fs_keys "$OCF_RESKEY_service_name"
-
-	cat > "$conf" <<EOT
-#
-# "$conf"
-#
-# This template configuration wass automatically generated, and will
-# be automatically regenerated if removed.  Please modify this file to
-# speficy subdirectories and/or client access permissions.
-#
-# Once this file has been altered, automatic re-generation will stop.
-# Remember to copy this file to all other cluster members after making
-# changes, or your SMB service will not operate correctly.
-#
-# From a cluster perspective, the key fields are:
-#     lock directory - must be unique per samba service.
-#     bind interfaces only - must be present set to yes.
-#     interfaces - must be set to service floating IP address.
-#     path - must be the service mountpoint or subdirectory thereof.
-#
-
-[global]
-        workgroup = $OCF_RESKEY_workgroup
-        pid directory = /var/run/samba/$OCF_RESKEY_name
-        lock directory = /var/cache/samba/$OCF_RESKEY_name
-	log file = /var/log/samba/%m.log
-	#private dir = /var/
-	encrypt passwords = yes
-	bind interfaces only = yes
-	netbios name = ${OCF_RESKEY_name/ /_}
-
-	#
-	# Interfaces are based on ip resources at the top level of
-	# "$OCF_RESKEY_service_name"; IPv6 addresses may or may not
-	# work correctly.
-	#
-	interfaces = $(build_ip_list)
-
-#
-# Shares based on fs resources at the top level of "$OCF_RESKEY_service_name"
-#
-EOT
-	add_fs_entries "$conf"
-	add_sha1 "$conf"
-
-	return 0
-}
-
-
-#
-# Kill off the specified PID
-# (from clumanager 1.0.x/1.2.x)
-#
-# Killing off the samba daemons was miserable to implement, merely
-# because killall doesn't distinguish by program commandline.
-# Consequently I had to implement these routines to selectively pick 'em off.
-#
-# Kills of either the {smbd|nmbd} which is running and was started with
-# the specified argument.  Can't use `killall` to do this because it
-# doesn't allow you to distinguish which process to kill based on any
-# of the program arguments.
-#
-# This routine is also called on "status" checks.  In this case it doesn't
-# actually kill anything.
-#
-# Parameters:
-#       daemonName - daemon name, can be either smbd or nmbd
-#       command - [stop|start|status]
-#       arg     - argument passed to daemon.  In this case its not the
-#                 full set of program args, rather its really just the
-#                 samba config file.
-#
-# Returns: 0 - success (or the daemon isn't currently running)
-#          1 - failure
-#
-kill_daemon_by_arg()
-{
-    	declare daemonName=$1
-	declare action=$2
-	declare arg=$3
-	# Create a unique temporary file to stash off intermediate results
-	declare tmpfile_str=/tmp/sambapids.XXXXXX
-	declare tmpfile
-	declare ret
-
-	tmpfile=$(mktemp $tmpfile_str); ret_val=$?
-
-	if [ -z "$tmpfile" ]; then
-		ocf_log err "kill_daemon_by_arg: Can't create tmp file"
-		return $_FAIL
-	fi
-
-	# Mumble, need to strip off the /etc/samba portion, otherwise the
-	# grep pattern matching will fail.
-	declare confFile="$(basename $arg)"
-
-	# First generate a list of candidate pids.
-	pidof $daemonName > $tmpfile
-	if [ $? -ne 0 ]; then
-		ocf_log debug "kill_daemon_by_arg: no pids for $daemonName"
-		rm -f $tmpfile
-		case "$action" in
-		'stop')
-			return 0
-		;;
-		'status')
-			return $_FAIL
-		;;
-		esac
-		return 0
-	fi
-
-	# If you don't find any matching daemons for a "stop" operation, thats
-	# considered success; whereas for "status" inquiries its a failure.
-	case "$action" in
-	'stop')
-		ret=0
-	;;
-	'status')
-		ret=$_FAIL
-	;;
-	esac
-	#
-	# At this point tmpfile contains a set of pids for the corresponding
-	# {smbd|nmbd}.  Now look though this candidate set of pids and compare
-	# the program arguments (samba config file name).  This distinguishes
-	# which ones should be killed off.
-	#
-	declare daemonPid=""
-	for daemonPid in $(cat $tmpfile); do
-		declare commandLine=$(cat /proc/$daemonPid/cmdline)
-		declare confBase="$(basename $commandLine)"
-		if [ "$confBase" = "$confFile" ]; then
-			case "$action" in
-			'status')
-				rm -f $tmpfile
-				return 0
-			;;
-			esac
-			kill_daemon_pid $daemonPid
-			if [ $? -ne 0 ]; then
-				ret=$_FAIL
-				ocf_log err \
-				"kill_daemon_by_arg: kill_daemon_pid $daemonPid failed"
-			else
-				ocf_log debug \
-				 "kill_daemon_by_arg: kill_daemon_pid $daemonPid success"
-			fi
-		fi
-	done
-	rm -f $tmpfile
-	return $ret
-}
-
-
-#
-# Kill off the specified PID
-# (from clumanager 1.0.x/1.2.x)
-#
-kill_daemon_pid()
-{
-	declare pid=$1
-	declare retval=0
-
-
-	kill -TERM $pid
-	if [ $? -eq 0 ]; then
-		ocf_log debug "Samba: successfully killed $pid"
-	else
-		ocf_log debug "Samba: failed to kill $pid"
-		retval=$_FAIL
-	fi
-	return $retval
-}
-
-
-share_start_stop()
-{
-	declare command=$1
-	declare conf="$SAMBA_CONFIG_DIR/smb.conf.$OCF_RESKEY_name"
-	declare smbd_command
-	declare nmbd_command
-	declare netbios_name
-	
-	#
-	# Specify daemon options
-	# -D = spawn off as separate daemon
-	# -s = the following arg specifies the config file
-	#
-	declare smbd_options="-D -s"
-	declare nmbd_options="-D -s"
-
-	if [ "$command" = "start" ]; then
-		gen_smb_conf "$conf"
-	else 
-		if ! [ -f "$conf" ]; then
-			ocf_log warn "\"$conf\" missing during $command"
-		fi
-	fi
-
-	#
-	# On clusters with multiple samba shares, we need to ensure (as much
-	# as possible) that each service is advertised as a separate netbios
-	# name.
-	#
-	# Generally, the admin sets this in smb.conf.NAME - but since
-	# it is not required, we need another option.  Consequently, we use
-	# smb instance name (which must be unique)
-	#
-	if [ -f "$conf" ]; then
-		grep -qe "^\([[:space:]]\+n\|n\)etbios[[:space:]]\+name[[:space:]]*=[[:space:]]*[[:alnum:]]\+" "$conf"
-		if [ $? -ne 0 ]; then
-
-			netbios_name=$OCF_RESKEY_name
-
-			ocf_log notice "Using $netbios_name as NetBIOS name (service $OCF_RESKEY_service_name)"
-			nmbd_options=" -n $netbios_name $nmbd_options"
-		fi
-	fi
-
-	case $command in
-	start)
-		ocf_log info "Starting Samba instance \"$OCF_RESKEY_name\""
-		mkdir -p "$SAMBA_PID_DIR/$OCF_RESKEY_name"
-		mkdir -p "$SAMBA_LOCK_DIR/$OCF_RESKEY_name"
-
-		[ -f "$SMBD_COMMAND" ] || exit $OCF_ERR_INSTALLED
-		[ -f "$NMBD_COMMAND" ] || exit $OCF_ERR_INSTALLED
-
-		# Kick off the per-service smbd
-		$SMBD_COMMAND $smbd_options "$conf"
-		ret_val=$?
-		if [ $ret_val -ne 0 ]; then
-			ocf_log err "Samba service failed: $SMBD_COMMAND $smbd_options \"$conf\""
-			return $_FAIL
-		fi
-		ocf_log debug "Samba service succeeded: $SMBD_COMMAND $smbd_options \"$conf\""
-
-		# Kick off the per-service nmbd
-		$NMBD_COMMAND $nmbd_options "$conf"
-		ret_val=$?
-		if [ $ret_val -ne 0 ]; then
-			ocf_log err "Samba service failed: $NMBD_COMMAND $nmbd_options \"$conf\""
-			return $_FAIL
-		fi
-		ocf_log debug "Samba service succeeded: $NMBD_COMMAND $nmbd_options \"$conf\""
-	;;
-	stop)
-		ocf_log info "Stopping Samba instance \"$OCF_RESKEY_name\""
-
-       		kill_daemon_by_arg "nmbd" $command "$conf"
-       		kill_daemon_by_arg "smbd" $command "$conf"
-       		if [ "$SAMBA_PID_DIR/$OCF_RESKEY_name" != "/" ]; then
-       			pushd "$SAMBA_PID_DIR" &> /dev/null
-       			rm -rf "$OCF_RESKEY_name"
-	       		popd &> /dev/null
-		fi
-		if [ "$SAMBA_LOCK_DIR/$OCF_RESKEY_name" != "/" ]; then
-     			pushd "$SAMBA_LOCK_DIR" &> /dev/null
-			rm -rf "$OCF_RESKEY_name"
-			popd &> /dev/null
-		fi
-	;;
-	status)
-		ocf_log debug "Checking Samba instance \"$OCF_RESKEY_name\""
-		kill_daemon_by_arg "nmbd" $command "$conf"
-		if [ $? -ne 0 ]; then
-			ocf_log err \
-			"share_start_stop: nmbd for service $svc_name died!"
-			return $_FAIL
-		fi
-		kill_daemon_by_arg "smbd" $command "$conf"
-		if [ $? -ne 0 ]; then
-			ocf_log err \
-		"share_start_stop: nmbd for service $svc_name died!"
-			return $_FAIL
-		fi
-	;;
-	esac
-}
-
-
-verify_all()
-{
-	[ -z "$OCF_RESKEY_workgroup" ] && export OCF_RESKEY_workgroup="LINUXCLUSTER"
-	[ -n "${OCF_RESKEY_name}" ] || exit $OCF_ERR_ARGS      # Invalid Argument
-	if [ -z "${OCF_RESKEY_service_name}" ]; then
-		ocf_log ERR "Samba service ${OCF_RESKEY_name} is not the child of a service"
-		exit $OCF_ERR_ARGS
-	fi
-}
-
-case $1 in
-	meta-data)
-		meta_data
-		exit 0
-	;;
-	start|stop)
-		verify_all
-		share_start_stop $1
-		exit $?
-	;;
-	status|monitor)
-		verify_all
-		share_start_stop status
-		exit $?
-	;;
-	validate-all)
-		verify_all
-		echo "Yer radio's workin', driver!"
-		exit 0
-	;;
-	*)
-		echo "usage: $0 {start|stop|status|monitor|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-	;;
-esac
-
diff --git a/rgmanager/src/resources/svclib_nfslock b/rgmanager/src/resources/svclib_nfslock
deleted file mode 100644
index 6ea3f42..0000000
--- a/rgmanager/src/resources/svclib_nfslock
+++ /dev/null
@@ -1,262 +0,0 @@
-#!/bin/bash
-# Do reclaim-broadcasts when we kill lockd during shutdown/startup
-# of a cluster service.
-#
-# Exported functions:
-#
-#  notify_list_store
-#  notify_list_merge
-#  notify_list_broadcast
-#
-
-#
-# Usage:
-# statd_notify <directory> <hostname|ip>
-#
-# Copy out a list from <directory>, merge them with the system nfs lock
-# list, and send them out as <hostname|ip> after generating a random
-# state (needed so clients will reclaim their locks)
-#
-nfslock_statd_notify()
-{
-	declare tmpdir
-	declare nl_dir=$1
-	declare nl_ip=$2
-	declare command		# Work around bugs in rpc.statd
-	declare pid_xxx		# Work around bugs in rpc.statd
-	declare owner
-
-	[ -z "$lockd_pid" ] && return 0
-	if ! [ -d $nl_dir ]; then
-		return 0
-	fi
-
-	if [ -z "`ls $nl_dir/sm/* 2> /dev/null`" ]; then
-		ocf_log debug "No hosts to notify"
-		return 0
-	fi
-	
-	tmpdir=$(mktemp -d /tmp/statd-$2.XXXXXX)
-
-	# Ok, copy the HA directory to something we can use.
-       	mkdir -p $tmpdir/sm
-	
-	# Copy in our specified entries
-	cp -f $nl_dir/sm/* $tmpdir/sm
-
-	# Copy in our global entries
-	# XXX This might be what we just copied.
-
-	if [ -d "/var/lib/nfs/statd/sm" ]; then
-		owner=$(ls -dl /var/lib/nfs/statd/sm | awk '{print $3"."$4}')
-		cp -f /var/lib/nfs/statd/sm/* $tmpdir/sm
-	elif [ -d "/var/lib/nfs/sm" ]; then
-		owner=$(ls -dl /var/lib/nfs/statd/sm | awk '{print $3"."$4}')
-		cp -f /var/lib/nfs/sm/* $tmpdir/sm
-	fi
-
-	#
-	# Generate a random state file.  If this ends up being what a client
-	# already has in its list, that's bad, but the chances of this
-	# are small - and relocations should be rare.
-	#
-	dd if=/dev/urandom of=$tmpdir/state bs=1 count=4 &> /dev/null
-
-	#
-	# Make sure we set permissions, or statd will not like it.
-	#
-	chown -R $owner $tmpdir
-
-	#
-	# Tell rpc.statd to notify clients.  Don't go into background, 
-	# because statd is buggy and won't exit like it's supposed to after
-	# sending the notifications out.
-	#
-	ocf_log info "Sending reclaim notifications via $nl_ip"
-	command="rpc.statd -NFP $tmpdir -n $nl_ip"
-	eval $command 2>&1 &
-	sleep 3 # XXX - the instance of rpc.statd we just spawned is supposed
-	        # to exit after it finishes notifying clients.
-	        # rpc.statd spawned which is still running handles the actual
-	        # new SM_MON requests... we hope 3 seconds is enough time
-	        # to get all the SM_NOTIFY messages out.  rpc.statd = bugged
-	#
-	# clean up
-	#
-	pid_xxx=`ps auwwx | grep "$command" | grep -v grep | awk '{print $2}'`
-	kill $pid_xxx
-	rm -rf $tmpdir
-
-	return 0
-}
-
-
-#
-# Copy of isSlave from svclib_ip and/or ip.sh
-#
-nfslock_isSlave()
-{
-        declare intf=$1
-        declare line
-
-        if [ -z "$intf" ]; then
-                ocf_log err "usage: isSlave <I/F>"
-                return 1
-        fi
-
-        line=$(/sbin/ip link list dev $intf)
-        if [ $? -ne 0 ]; then
-                ocf_log err "$intf not found"
-                return 1
-        fi
-
-        if [ "$line" = "${line/<*SLAVE*>/}" ]; then
-                return 2
-        fi
-
-        # Yes, it is a slave device.  Ignore.
-        return 0
-}
-
-
-#
-# Get all the IPs on the system except loopback IPs
-#
-nfslock_ip_address_list()
-{
-        declare idx dev family ifaddr
-
-        while read idx dev family ifaddr; do
-
-		if [ "$family" != "inet" ] && [ "$family" != "inet6" ]; then
-			continue
-		fi
-
-		if [ "$dev" = "lo" ]; then
-			# Ignore loopback
-			continue
-		fi
-
-                nfslock_isSlave $dev
-                if [ $? -ne 2 ]; then
-                        continue
-                fi
-
-                idx=${idx/:/}
-
-                echo $dev $family ${ifaddr/\/*/} ${ifaddr/*\//}
-
-        done < <(/sbin/ip -o addr list | awk '{print $1,$2,$3,$4}')
-
-        return 0
-}
-	
-
-#
-# Usage: broadcast_notify <state_directory>
-#
-# Send the contents of <state_directory> out via all IPs on the system.
-#
-notify_list_broadcast()
-{
-        declare dev family addr maskbits ip_name
-	declare lockd_pid=$(pidof lockd)
-	declare nl_dir=$1
-
-	# First of all, send lockd a SIGKILL.  We hope nfsd is running.
-	# If it is, this will cause lockd to reset the grace period for
-	# lock reclaiming.
-	if [ -n "$lockd_pid" ]; then
-		ocf_log info "Asking lockd to drop locks (pid $lockd_pid)"
-		kill -9 $lockd_pid
-	else
-		ocf_log warning "lockd not running; cannot notify clients"
-		return 1
-	fi
-	
-        while read dev family addr maskbits; do
-		if [ "$family" != "inet" ]; then
-			continue
-		fi
-
-		ip_name=$(clufindhostname -i $addr)
-		if [ -z "$ip_name" ]; then
-			nfslock_statd_notify $nl_dir $addr
-		else
-			nfslock_statd_notify $nl_dir $ip_name
-		fi
-
-	done < <(nfslock_ip_address_list)
-}
-
-
-#
-# Store the lock monitor list from rpc.statd - do this during a teardown
-# after the IP addresses of a service have been taken offline.  Note that
-# this should be done by HA-callout programs, but this feature is not in
-# RHEL3. 
-#
-notify_list_store()
-{
-	declare nl_dir=$1
-	declare owner
-
-	mkdir -p $nl_dir/sm
-
-	if [ -d "/var/lib/nfs/statd/sm" ]; then
-	        if [ -z "`ls /var/lib/nfs/statd/sm/* 2> /dev/null`" ]; then
-			return 1
-			# nothing to do!
-		fi
-
-		owner=$(ls -dl /var/lib/nfs/statd/sm | awk '{print $3"."$4}')
-		cp -af /var/lib/nfs/statd/sm/* $nl_dir/sm
-		chown -R $owner $nl_dir
-		return 0
-	elif [ -d "/var/lib/nfs/sm" ]; then
-	        if [ -z "`ls /var/lib/nfs/sm/* 2> /dev/null`" ]; then
-			return 1
-			# nothing to do!
-		fi
-
-		owner=$(ls -dl /var/lib/nfs/sm | awk '{print $3"."$4}')
-		cp -af /var/lib/nfs/sm/* $nl_dir/sm
-		chown -R $owner $nl_dir
-		return 0
-	fi
-
-	return 1
-}
-
-
-#
-# Merge the contents of <nl_dir>/sm with the system-wide list
-# Make sure ownership is right, or statd will hiccup.  This should not
-# actually ever be needed because statd will, upon getting a SM_MON
-# request, create all the entries in this list.  It's mostly for
-# housekeeping for next time we relocate the service.
-#
-notify_list_merge()
-{
-	declare nl_dir=$1
-	declare owner
-
-	if [ -z "`ls $nl_dir/* 2> /dev/null`" ]; then
-		return 1
-	fi
-
-	if [ -d "/var/lib/nfs/statd/sm" ]; then
-		owner=$(ls -dl /var/lib/nfs/statd/sm | awk '{print $3"."$4}')
- 		cp -af $nl_dir/sm/* /var/lib/nfs/statd/sm
-		chown -R $owner $nl_dir
-		return 0
-	elif [ -d "/var/lib/nfs/sm" ]; then
-		owner=$(ls -dl /var/lib/nfs/sm | awk '{print $3"."$4}')
- 		cp -af $nl_dir/sm/* /var/lib/nfs/sm
-		chown -R $owner $nl_dir
-		return 0
-	fi
-
-	return 1
-}
-
diff --git a/rgmanager/src/resources/tomcat-5.metadata b/rgmanager/src/resources/tomcat-5.metadata
deleted file mode 100644
index 021bef7..0000000
--- a/rgmanager/src/resources/tomcat-5.metadata
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="tomcat-5">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of Tomcat server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a Tomcat server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/tomcat5/tomcat5.conf"/>
-        </parameter>
-
-	<parameter name="tomcat_user">
-		<longdesc lang="en">
-			User who runs the Tomcat server
-		</longdesc>
-		<shortdesc lang="en">
-			User who runs the Tomcat server
-		</shortdesc>
-		<content type="string" default="tomcat" />
-	</parameter>
-
-	<parameter name="catalina_options">
-		<longdesc lang="en">
-			Other command-line options for Catalina
-		</longdesc>
-		<shortdesc lang="en">
-			Other command-line options for Catalina
-		</shortdesc>
-		<content type="string" />
-	</parameter>
-
-	<parameter name="catalina_base">
-		<longdesc lang="en">
-			Cataliny base directory
-		</longdesc>
-		<shortdesc lang="en">
-			Catalina base directory (differs for each service)
-		</shortdesc>
-		<content type="string" default="/usr/share/tomcat5" />
-	</parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" default="30" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/tomcat-5.sh b/rgmanager/src/resources/tomcat-5.sh
deleted file mode 100644
index a84b450..0000000
--- a/rgmanager/src/resources/tomcat-5.sh
+++ /dev/null
@@ -1,256 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare TOMCAT_TOMCAT=/usr/bin/dtomcat5
-declare TOMCAT_RELINK=/usr/share/tomcat5/bin/relink
-declare TOMCAT_pid_file="`generate_name_for_pid_file`"
-declare TOMCAT_conf_dir="`generate_name_for_conf_dir`/conf"
-declare TOMCAT_gen_config_file="$TOMCAT_conf_dir/server.xml"
-declare TOMCAT_gen_catalina_base="`generate_name_for_conf_dir`"
-
-declare JAVA_HOME
-declare CATALINA_HOME
-declare CATALINA_BASE
-declare CATALINA_TMPDIR
-declare CLASSPATH
-declare TOMCAT_USER
-##
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	. "$OCF_RESKEY_config_file"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_verify $CLOG_FAILED "Error In The File \"$OCF_RESKEY_config_file\""
-		return $OCF_ERR_ARGS
-	fi 
-
-	if [ -z "$JAVA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "JAVA_HOME Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$JAVA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "JAVA_HOME Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$JAVA_ENDORSED_DIRS" ]; then
-		clog_service_verify $CLOG_FAILED "JAVA_ENDORSED_DIRS Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$JAVA_ENDORSED_DIRS" ]; then
-		clog_service_verify $CLOG_FAILED "JAVA_ENDORSED_DIRS Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$CATALINA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_HOME Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$CATALINA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_HOME Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$CATALINA_TMPDIR" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_TMPDIR Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$CATALINA_TMPDIR" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_TMPDIR Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$TOMCAT_USER" ]; then
-		clog_service_verify $CLOG_FAILED "TOMCAT_USER Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_addresses="$3"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-#	generate_configTemplate "$generated_file" "$original_file"
-	$(dirname $0)/utils/tomcat-parse-config.pl $ip_addresses < "$original_file" >> "$generated_file"
-
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$TOMCAT_conf_dir"
-	check_pid_file "$TOMCAT_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$TOMCAT_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-	generate_config_file "$OCF_RESKEY_catalina_base/conf/server.xml" "$TOMCAT_gen_config_file" "$ip_addresses"
-	ln -s "$OCF_RESKEY_catalina_base"/* "$TOMCAT_gen_catalina_base" &> /dev/null
-	ln -s "$OCF_RESKEY_catalina_base"/conf/* "$TOMCAT_gen_catalina_base"/conf &> /dev/null
-	
-	CLASSPATH="$JAVA_HOME"/lib/tools.jar:"$CATALINA_HOME"/bin/bootstrap.jar:"$CATALINA_HOME"/bin/commons-logging-api.jar:`/usr/bin/build-classpath mx4j/mx4j-impl`:`/usr/bin/build-classpath mx4j/mx4j-jmx`
-
-	su "$TOMCAT_USER"  -c " \"$JAVA_HOME/bin/java\" $JAVA_OPTS $OCF_RESKEY_catalina_options \
-		-Djava.endorsed.dirs=\"$JAVA_ENDORSED_DIRS\" -classpath \"$CLASSPATH\" \
-		-Dcatalina.base=\"$TOMCAT_gen_catalina_base\" \
-		-Dcatalina.home=\"$CATALINA_HOME\" \
-		-Djava.io.tmpdir=\"$CATALINA_TMPDIR\" \
-		org.apache.catalina.startup.Bootstrap \"$@\" start " \
-		>> "$TOMCAT_gen_catalina_base"/logs/catalina.out 2>&1 &
-	                                                
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ -z "$!" ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	echo $! > "$TOMCAT_pid_file"
-
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$TOMCAT_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-        if [ -e "$TOMCAT_pid_file" ]; then
-		rm -f "$TOMCAT_pid_file"
-	fi
-                                
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$TOMCAT_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$TOMCAT_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/tomcat-6.metadata b/rgmanager/src/resources/tomcat-6.metadata
deleted file mode 100644
index 493e0d5..0000000
--- a/rgmanager/src/resources/tomcat-6.metadata
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="tomcat-6">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-        This defines an instance of Tomcat server
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a Tomcat server
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-	    <longdesc lang="en">
-	        Specifies a service name for logging and other purposes
-	    </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-
-        <parameter name="config_file">
-            <longdesc lang="en">
-                Define absolute path to configuration file
-            </longdesc>
-            <shortdesc lang="en">
-                Config File
-            </shortdesc>
-	    <content type="string" default="/etc/tomcat6/tomcat6.conf"/>
-        </parameter>
-
-	<parameter name="shutdown_wait">
-		<longdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</longdesc>
-		<shortdesc lang="en">
-			Wait X seconds for correct end of service shutdown
-		</shortdesc>
-		<content type="integer" default="30" />
-	</parameter>
-
-        <parameter name="service_name" inherit="service%name">
-            <longdesc lang="en">
-	    	Inherit the service name.  We need to know
-		the service name in order to determine file
-		systems and IPs for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Inherit the service name.
-            </shortdesc>
-	    <content type="string"/>
-        </parameter>
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="0"/>
-	<action name="stop" timeout="0"/>
-
-	<!-- Checks to see if it''s mounted in the right place -->
-	<action name="status" interval="1m" timeout="10"/>
-	<action name="monitor" interval="1m" timeout="10"/>
-
-	<!-- Checks to see if we can read from the mountpoint -->
-	<action name="status" depth="10" timeout="30" interval="5m"/>
-	<action name="monitor" depth="10" timeout="30" interval="5m"/>
-
-	<action name="meta-data" timeout="0"/>
-	<action name="validate-all" timeout="0"/>
-    </actions>
-
-    <special tag="rgmanager">
-    </special>
-</resource-agent>
diff --git a/rgmanager/src/resources/tomcat-6.sh b/rgmanager/src/resources/tomcat-6.sh
deleted file mode 100644
index 3371ea5..0000000
--- a/rgmanager/src/resources/tomcat-6.sh
+++ /dev/null
@@ -1,222 +0,0 @@
-#!/bin/bash
-
-export LC_ALL=C
-export LANG=C
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-. $(dirname $0)/ocf-shellfuncs
-. $(dirname $0)/utils/config-utils.sh
-. $(dirname $0)/utils/messages.sh
-. $(dirname $0)/utils/ra-skelet.sh
-
-declare TOMCAT_pid_file="`generate_name_for_pid_file`"
-declare TOMCAT_conf_dir="`generate_name_for_conf_dir`/conf"
-declare TOMCAT_gen_config_file="$TOMCAT_conf_dir/server.xml"
-declare TOMCAT_gen_catalina_base="`generate_name_for_conf_dir`"
-
-declare CATALINA_HOME
-declare CATALINA_BASE
-declare CATALINA_TMPDIR
-declare CLASSPATH
-declare TOMCAT_USER
-##
-
-verify_all()
-{
-	clog_service_verify $CLOG_INIT
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		clog_service_verify $CLOG_FAILED "Invalid Name Of Service"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_service_name" ]; then
-		clog_service_verify $CLOG_FAILED_NOT_CHILD
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -z "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$OCF_RESKEY_config_file"
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ ! -r "$OCF_RESKEY_config_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_READABLE $OCF_RESKEY_config_file
-		clog_service_verify $CLOG_FAILED
-		return $OCF_ERR_ARGS
-	fi
-
-	. "$OCF_RESKEY_config_file"
-
-	if [ $? -ne 0 ]; then
-		clog_service_verify $CLOG_FAILED "Error In The File \"$OCF_RESKEY_config_file\""
-		return $OCF_ERR_ARGS
-	fi 
-
-	if [ -z "$CATALINA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_HOME Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$CATALINA_HOME" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_HOME Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$CATALINA_TMPDIR" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_TMPDIR Not Specified In ${OCF_RESKEY_config_file}"
-		return $OCF_ERR_ARGS;
-	fi	
-
-	if [ ! -d "$CATALINA_TMPDIR" ]; then
-		clog_service_verify $CLOG_FAILED "CATALINA_TMPDIR Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	if [ -z "$TOMCAT_USER" ]; then
-		clog_service_verify $CLOG_FAILED "TOMCAT_USER Does Not Exist"
-		return $OCF_ERR_ARGS;
-	fi
-
-	clog_service_verify $CLOG_SUCCEED
-		
-	return 0
-}
-
-generate_config_file()
-{
-	declare original_file="$1"
-	declare generated_file="$2"
-	declare ip_addresses="$3"
-
-	if [ -f "$generated_file" ]; then
-		sha1_verify "$generated_file"
-		if [ $? -ne 0 ]; then
-			clog_check_sha1 $CLOG_FAILED
-			return 0
-		fi
-	fi	
-
-	clog_generate_config $CLOG_INIT "$original_file" "$generated_file"
-
-	$(dirname $0)/utils/tomcat-parse-config.pl $ip_addresses < "$original_file" > "$generated_file"
-
-        sha1_addToFile "$generated_file"
-	clog_generate_config $CLOG_SUCCEED "$original_file" "$generated_file"
-               
-	return 0;
-}
-
-start()
-{
-	clog_service_start $CLOG_INIT
-
-	create_pid_directory
-	create_conf_directory "$TOMCAT_conf_dir"
-	check_pid_file "$TOMCAT_pid_file"
-
-	if [ $? -ne 0 ]; then
-		clog_check_pid $CLOG_FAILED "$TOMCAT_pid_file"
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-	clog_looking_for $CLOG_INIT "IP Addresses"
-
-        get_service_ip_keys "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list`
-
-	if [ -z "$ip_addresses" ]; then
-		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_looking_for $CLOG_SUCCEED "IP Addresses"
-
-	. "$OCF_RESKEY_config_file"
-
-	generate_config_file "$CATALINA_BASE/conf/server.xml" "$TOMCAT_gen_config_file" "$ip_addresses"
-	rm -f "$TOMCAT_gen_catalina_base/conf/tomcat6.conf"
-	( cat $OCF_RESKEY_config_file | grep -v 'CATALINA_PID=' | grep -v 'CATALINA_BASE='; echo CATALINA_BASE="$TOMCAT_gen_catalina_base"; echo CATALINA_PID="$TOMCAT_pid_file") > "$TOMCAT_gen_catalina_base/conf/tomcat6.conf" 
-	ln -s "$CATALINA_BASE"/* "$TOMCAT_gen_catalina_base" &> /dev/null
-	ln -s "$CATALINA_BASE"/conf/* "$TOMCAT_gen_catalina_base"/conf &> /dev/null
-	
-	export TOMCAT_CFG="$TOMCAT_gen_catalina_base/conf/tomcat6.conf"
-	/usr/sbin/tomcat6 start
-
-	if [ $? -ne 0 ]; then
-		clog_service_start $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_start $CLOG_SUCCEED
-
-	return 0;
-}
-
-stop()
-{
-	clog_service_stop $CLOG_INIT
-
-	stop_generic "$TOMCAT_pid_file" "$OCF_RESKEY_shutdown_wait"
-	
-	if [ $? -ne 0 ]; then
-		clog_service_stop $CLOG_FAILED
-		return $OCF_ERR_GENERIC
-	fi
-
-        if [ -e "$TOMCAT_pid_file" ]; then
-		rm -f "$TOMCAT_pid_file"
-	fi
-                                
-	clog_service_stop $CLOG_SUCCEED
-	return 0;
-}
-
-status()
-{
-	clog_service_status $CLOG_INIT
-
-	status_check_pid "$TOMCAT_pid_file"
-	if [ $? -ne 0 ]; then
-		clog_service_status $CLOG_FAILED "$TOMCAT_pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	clog_service_status $CLOG_SUCCEED
-	return 0
-}
-
-case $1 in
-	meta-data)
-		cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'`
-		exit 0
-		;;
-	validate-all)
-		verify_all
-		exit $?
-		;;
-	start)
-		verify_all && start
-		exit $?
-		;;
-	stop)
-		verify_all && stop
-		exit $?
-		;;
-	status|monitor)
-		verify_all
-		status
-		exit $?
-		;;
-	restart)
-		verify_all
-		stop
-		start
-		exit $?
-		;;
-	*)
-		echo "Usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-esac
diff --git a/rgmanager/src/resources/utils/config-utils.sh.in b/rgmanager/src/resources/utils/config-utils.sh.in
deleted file mode 100644
index e3a44d0..0000000
--- a/rgmanager/src/resources/utils/config-utils.sh.in
+++ /dev/null
@@ -1,242 +0,0 @@
-#!/bin/bash
-
-declare RA_COMMON_pid_dir=/var/run/cluster
-declare RA_COMMON_conf_dir=@CONFDIR@
-
-declare -i FAIL=255
-declare -a ip_keys
-
-generate_configTemplate()
-{
-	cat > $1 << EOT
-#
-# "$1" was created from the "$2"
-#
-# This template configuration was automatically generated, and will be
-# automatically regenerated if removed. Once this file has been altered,
-# automatic re-generation will stop. Remember to copy this file to all 
-# other cluster members after making changes, or your service will not 
-# operate correctly.
-#
-EOT
-}
-
-sha1_addToFile()
-{
-        declare sha1line="# rgmanager-sha1 $(sha1sum "$1")"
-        echo $sha1line >> "$1"
-}
-
-sha1_verify()
-{
-	declare sha1_new sha1_old
-	declare oldFile=$1
-
-	ocf_log debug "Checking: SHA1 checksum of config file $oldFile"
-
-	sha1_new=`cat $oldFile | grep -v "# rgmanager-sha1" | sha1sum | sed 's/^\([a-z0-9]\+\) .*$/\1/'`
-	sha1_old=`tail -n 1 $oldFile | sed 's/^# rgmanager-sha1 \(.*\)$/\1/' | sed 's/^\([a-z0-9]\+\) .*$/\1/'`
-
-	if [ "$sha1_new" = "$sha1_old" ]; then
-	        ocf_log debug "Checking: SHA1 checksum > succeed"
-		return 0;
-	else
-		ocf_log debug "Checking: SHA1 checksum > failed - file changed"
-		return 1;
-	fi
-}
-
-#
-# Usage: ccs_get key
-#
-ccs_get()
-{
-	declare outp
-	declare key
-
-	[ -n "$1" ] || return $FAIL
-
-	key="$*"
-
-	outp=$(ccs_tool query "$key" 2>&1)
-	if [ $? -ne 0 ]; then
-		if [[ "$outp" =~ "Query failed: Invalid argument" ]]; then
-			# This usually means that element does not exist
-			# e.g. when checking for IP address 
-			return 0;
-		fi
-
-		if [ "$outp" = "${outp/No data available/}" ] || [ "$outp" = "${outp/Operation not permitted/}" ]; then
-			ocf_log err "$outp ($key)"
-			return $FAIL
-		fi
-
-		# no real error, just no data available
-		return 0
-	fi
-
-	echo $outp
-
-	return 0
-}
-
-#
-# Build a list of service IP keys; traverse refs if necessary
-# Usage: get_service_ip_keys desc serviceName
-#
-get_service_ip_keys()
-{
-	declare svc=$1
-	declare -i x y=0
-	declare outp
-	declare key
-
-	#
-	# Find service-local IP keys
-	#
-	x=1
-	while : ; do
-		key="/cluster/rm/service[@name=\"$svc\"]/ip[$x]"
-
-		#
-		# Try direct method
-		#
-		outp=$(ccs_get "$key/@address")
-		if [ $? -ne 0 ]; then
-			return 1
-		fi
-
-		#
-		# Try by reference
-		#
-		if [ -z "$outp" ]; then
-			outp=$(ccs_get "$key/@ref")
-			if [ $? -ne 0 ]; then
-				return 1
-			fi
-			key="/cluster/rm/resources/ip[@address=\"$outp\"]"
-		fi
-
-		if [ -z "$outp" ]; then
-			break
-		fi
-
-		#ocf_log debug "IP $outp found @ $key"
-
-		ip_keys[$y]="$key"
-
-		((y++))
-		((x++))
-	done
-
-	ocf_log debug "$y IP addresses found for $svc/$OCF_RESKEY_name"
-
-	return 0
-}
-
-build_ip_list()
-{
-        declare ipaddrs ipaddr
-        declare -i x=0
-                        
-        while [ -n "${ip_keys[$x]}" ]; do
-              ipaddr=$(ccs_get "${ip_keys[$x]}/@address")
-              if [ -z "$ipaddr" ]; then
-                                   break
-              fi
-
-              ipaddrs="$ipaddrs $ipaddr"
-             ((x++))
-        done
-
-        echo $ipaddrs
-}
-
-generate_name_for_pid_file()
-{
-	declare filename=$(basename $0)
-	
-	echo "$RA_COMMON_pid_dir/$(basename $0 | sed 's/^\(.*\)\..*/\1/')/$OCF_RESOURCE_INSTANCE.pid"
-	
-	return 0;
-}
-
-generate_name_for_pid_dir()
-{
-	declare filename=$(basename $0)
-	
-	echo "$RA_COMMON_pid_dir/$(basename $0 | sed 's/^\(.*\)\..*/\1/')/$OCF_RESOURCE_INSTANCE"
-	
-	return 0;
-}
-
-generate_name_for_conf_dir()
-{
-	declare filename=$(basename $0)
-
-	echo "$RA_COMMON_conf_dir/$(basename $0 | sed 's/^\(.*\)\..*/\1/')/$OCF_RESOURCE_INSTANCE"
-	
-	return 0;
-}
-
-create_pid_directory()
-{
-	declare program_name="$(basename $0 | sed 's/^\(.*\)\..*/\1/')"
-	declare dirname="$RA_COMMON_pid_dir/$program_name"
-
-	if [ -d "$dirname" ]; then
-		return 0;
-	fi
-	
-	chmod 711 "$RA_COMMON_pid_dir"
-	mkdir -p "$dirname"
-	
-	if [ "$program_name" = "mysql" ]; then
-		chown mysql.root "$dirname"
-	elif [ "$program_name" = "tomcat-5" ]; then
-		chown tomcat.root "$dirname"
-	fi
-
-	return 0;
-}
-
-create_conf_directory()
-{
-	declare dirname="$1"
-
-	if [ -d "$dirname" ]; then
-		return 0;
-	fi
-	
-	mkdir -p "$dirname"
-	
-	return 0;
-}
-
-check_pid_file() {
-	declare pid_file="$1"
-
-	if [ -z "$pid_file" ]; then
-		return 1;
-	fi
-
-	if [ ! -e "$pid_file" ]; then
-		return 0;
-	fi
-
-	## if PID file is empty then it should be safe to remove it
-	read pid < "$pid_file"
-	if [ -z "$pid" ]; then
-		rm $pid_file
-		ocf_log debug "PID File \"$pid_file\" Was Removed - Zero length";
-		return 0;
-	fi
-
-	if [ ! -d /proc/`cat "$pid_file"` ]; then	
-		rm "$pid_file"
-		ocf_log debug "PID File \"$pid_file\" Was Removed - PID Does Not Exist";
-		return 0;
-	fi
-
-	return 1;
-}
diff --git a/rgmanager/src/resources/utils/fs-lib.sh b/rgmanager/src/resources/utils/fs-lib.sh
deleted file mode 100644
index 4f242f7..0000000
--- a/rgmanager/src/resources/utils/fs-lib.sh
+++ /dev/null
@@ -1,946 +0,0 @@
-#!/bin/bash
-
-#
-# File system common functions
-#
-
-LC_ALL=C
-LANG=C
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export LC_ALL LANG PATH
-
-# Private return codes
-FAIL=2
-NO=1
-YES=0
-YES_STR="yes"
-
-[ -z "$OCF_RESOURCE_INSTANCE" ] && export OCF_RESOURCE_INSTANCE="filesystem:$OCF_RESKEY_name"
-
-#
-# Using a global to contain the return value saves
-# clone() operations.  This is important to reduce
-# resource consumption during status checks.
-#
-# There is no way to return a string from a function
-# in bash without cloning the process, which is exactly
-# what we are trying to avoid.  So, we have to resort
-# to using a dedicated global variable.  This one is
-# for the real_device() function below.
-#
-declare REAL_DEVICE
-
-#
-# Stub ocf_log function for when we are using
-# quick_status, since ocf_log generally forks (and
-# sourcing ocf-shellfuncs forks -a lot-).
-#
-ocf_log()
-{
-	echo $*
-}
-
-#
-# Assume NFS_TRICKS are not available until we are
-# proved otherwise.
-#
-export NFS_TRICKS=1
-
-#
-# Quick status doesn't fork() or clone() when using
-# device files directly.  (i.e. not symlinks, LABEL= or
-# UUID=
-#
-if [ "$1" = "status" -o "$1" = "monitor" ] &&
-   [ "$OCF_RESKEY_quick_status" = "1" ]; then
-	echo Using Quick Status
-
-	# XXX maybe we can make ocf-shellfuncs have a 'quick' mode too?
-	export OCF_SUCCESS=0
-	export OCF_ERR_GENERIC=1
-else
-	#
-	# Grab nfs lock tricks if available
-	#
-	if [ -f "$(dirname $0)/svclib_nfslock" ]; then
-		. $(dirname $0)/svclib_nfslock
-		NFS_TRICKS=0
-	fi
-
-	. $(dirname $0)/ocf-shellfuncs
-fi
-
-
-verify_name()
-{
-	if [ -z "$OCF_RESKEY_name" ]; then
-		ocf_log err "No file system name specified."
-		return $OCF_ERR_ARGS
-	fi
-	return $OCF_SUCCESS
-}
-
-
-verify_mountpoint()
-{
-	if [ -z "$OCF_RESKEY_mountpoint" ]; then
-		ocf_log err "No mount point specified."
-		return $OCF_ERR_ARGS
-	fi
-
-	if ! [ -e "$OCF_RESKEY_mountpoint" ]; then
-		ocf_log info "Mount point $OCF_RESKEY_mountpoint will be "\
-				"created at mount time."
-		return $OCF_SUCCESS
-	fi
-
-	[ -d "$OCF_RESKEY_mountpoint" ] && return $OCF_SUCCESS
-
-	ocf_log err "$OCF_RESKEY_mountpoint exists but is not a directory."
-
-	return $OCF_ERR_ARGS
-}
-
-
-#
-# This used to be called using $(...), but doing this causes bash
-# to set up a pipe and clone().  So, the output of this function is
-# stored in the global variable REAL_DEVICE, declared previously.
-#
-real_device()
-{
-	declare dev="$1"
-	declare realdev
-
-	REAL_DEVICE=""
-
-	[ -z "$dev" ] && return $OCF_ERR_ARGS
-
-	# Oops, we have a link.  Sorry, this is going to fork.
-	if [ -h "$dev" ]; then
-		realdev=$(readlink -f $dev)
-		if [ $? -ne 0 ]; then
-			return $OCF_ERR_ARGS
-		fi
-		REAL_DEVICE="$realdev"
-		return $OCF_SUCCESS
-	fi
-
-	# If our provided blockdev is a device, we are done
-	if [ -b "$dev" ]; then
-		REAL_DEVICE="$dev"
-		return $OCF_SUCCESS
-	fi
-
-	# It's not a link, it's not a block device.  If it also
-	# does not match UUID= or LABEL=, then findfs is not
-	# going to find anything useful, so we should quit now.
-	if [ "${dev/UUID=/}" = "$dev" ] &&
-	   [ "${dev/LABEL=/}" = "$dev" ]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	# When using LABEL= or UUID=, we can't save a fork.
-	realdev=$(findfs "$dev" 2> /dev/null)
-	if [ -n "$realdev" ] && [ -b "$realdev" ]; then
-		REAL_DEVICE="$realdev"
-		return $OCF_SUCCESS
-	fi
-
-	return $OCF_ERR_GENERIC
-}
-
-
-verify_device()
-{
-	declare realdev
-
-	if [ -z "$OCF_RESKEY_device" ]; then
-	       ocf_log err "No device or label specified."
-	       return $OCF_ERR_ARGS
-	fi
-
-	real_device "$OCF_RESKEY_device"
-	realdev="$REAL_DEVICE"
-	if [ -n "$realdev" ]; then
-		if [ "$realdev" != "$OCF_RESKEY_device" ]; then
-			ocf_log info "Specified $OCF_RESKEY_device maps to $realdev"
-		fi
-		return $OCF_SUCCESS
-	fi
-
-	ocf_log err "Device or label \"$OCF_RESKEY_device\" not valid"
-
-	return $OCF_ERR_ARGS
-}
-
-
-#
-# mount_in_use device mount_point
-#
-# Check to see if either the device or mount point are in use anywhere on
-# the system.  It is not required that the device be mounted on the named
-# moint point, just if either are in use.
-#
-mount_in_use () {
-	declare mp tmp_mp
-	declare dev tmp_dev
-	declare junka junkb junkc junkd
-
-	if [ $# -ne 2 ]; then
-		ocf_log err "Usage: mount_in_use device mount_point".
-		return $FAIL
-	fi
-
-	dev="$1"
-	mp="$2"
-
-	while read -r tmp_dev tmp_mp junka junkb junkc junkd; do
-		# XXX fork/clone warning XXX
-		if [ "${tmp_dev:0:1}" != "-" ]; then
-			tmp_dev="$(printf "$tmp_dev")"
-		fi
-
-		if [ -n "$tmp_dev" -a "$tmp_dev" = "$dev" ]; then
-			return $YES
-		fi
-
-		# Mountpoint from /proc/mounts containing spaces will
-		# have spaces represented in octal.  printf takes care
-		# of this for us.
-		tmp_mp="$(printf "$tmp_mp")"
-
-		if [ -n "$tmp_mp" -a "$tmp_mp" = "$mp" ]; then
-			return $YES
-		fi
-	done < /proc/mounts
-
-	return $NO
-}
-
-
-#
-# is_mounted device mount_point
-#
-# Check to see if the device is mounted.  Print a warning if its not
-# mounted on the directory we expect it to be mounted on.
-#
-is_mounted () {
-
-	declare mp tmp_mp
-	declare dev tmp_dev
-	declare ret=$FAIL
-	declare found=1
-	declare poss_mp
-
-	if [ $# -ne 2 ]; then
-		ocf_log err "Usage: is_mounted device mount_point"
-		return $FAIL
-	fi
-
-	real_device "$1"
-	dev="$REAL_DEVICE"
-	if [ -z "$dev" ]; then
-		ocf_log err "$OCF_RESOURCE_INSTANCE: is_mounted: Could not match $1 with a real device"
-		return $OCF_ERR_ARGS
-	fi
-
-	if [ -h "$2" ]; then
-		mp="$(readlink -f $2)"
-	else
-		mp="$2"
-	fi
-
-	ret=$NO
-
-	# This bash glyph simply removes a trailing slash
-	# if one exists.  /a/b/ -> /a/b; /a/b -> /a/b.
-	mp="${mp%/}"
-
-	while read -r tmp_dev tmp_mp junk_a junk_b junk_c junk_d
-	do
-		# XXX fork/clone warning XXX
-		if [ "${tmp_dev:0:1}" != "-" ]; then
-			tmp_dev="$(printf "$tmp_dev")"
-		fi
-
-		real_device "$tmp_dev"
-		tmp_dev="$REAL_DEVICE"
-
-		# XXX fork/clone warning XXX
-		# Mountpoint from /proc/mounts containing spaces will
-		# have spaces represented in octal.  printf takes care
-		# of this for us.
-		tmp_mp="$(printf "$tmp_mp")"
-
-		if [ -n "$tmp_dev" -a "$tmp_dev" = "$dev" ]; then
-			#
-			# Check to see if its mounted in the right
-			# place
-			#
-			if [ -n "$tmp_mp" ]; then
-				if [ "$tmp_mp" != "$mp" ]; then
-					poss_mp=$tmp_mp
-				else
-					found=0
-				fi
-			fi
-			ret=$YES
-		fi
-	done < /proc/mounts
-
-	if [ $ret -eq $YES ] && [ $found -ne 0 ]; then
-		ocf_log warn "Device $dev is mounted on $poss_mp instead of $mp"
-	fi
-
-	return $ret
-}
-
-
-#
-# is_alive mount_point
-#
-# Check to see if mount_point is alive (testing read/write)
-#
-is_alive()
-{
-	declare errcode
-	declare mount_point="$1"
-	declare file=".writable_test.$(hostname)"
-	declare rw
-
-	if [ $# -ne 1 ]; then
-	        ocf_log err "Usage: is_alive mount_point"
-		return $FAIL
-	fi
-
-	[ -z "$OCF_CHECK_LEVEL" ] && export OCF_CHECK_LEVEL=0
-
-	test -d "$mount_point"
-	if [ $? -ne 0 ]; then
-		ocf_log err "${OCF_RESOURCE_INSTANCE}: is_alive: $mount_point is not a directory"
-		return $FAIL
-	fi
-
-	[ $OCF_CHECK_LEVEL -lt 10 ] && return $YES
-
-	# depth 10 test (read test)
-	ls "$mount_point" > /dev/null 2> /dev/null
-	errcode=$?
-	if [ $errcode -ne 0 ]; then
-		ocf_log err "${OCF_RESOURCE_INSTANCE}: is_alive: failed read test on [$mount_point]. Return code: $errcode"
-		return $NO
-	fi
-
-	[ $OCF_CHECK_LEVEL -lt 20 ] && return $YES
-
-	# depth 20 check (write test)
-	rw=$YES
-	for o in `echo $OCF_RESKEY_options | sed -e s/,/\ /g`; do
-                if [ "$o" = "ro" ]; then
-		        rw=$NO
-                fi
-	done
-	if [ $rw -eq $YES ]; then
-	        file="$mount_point"/$file
-		while true; do
-			if [ -e "$file" ]; then
-				file=${file}_tmp
-				continue
-			else
-			        break
-			fi
-		done
-		touch $file > /dev/null 2> /dev/null
-		errcode=$?
-		if [ $errcode -ne 0 ]; then
-			ocf_log err "${OCF_RESOURCE_INSTANCE}: is_alive: failed write test on [$mount_point]. Return code: $errcode"
-			return $NO
-		fi
-		rm -f $file > /dev/null 2> /dev/null
-	fi
-
-	return $YES
-}
-
-
-#
-# Decide which quota options are enabled and return a string
-# which we can pass to quotaon
-#
-quota_opts()
-{
-	declare quotaopts=""
-	declare opts="$1"
-	declare mopt
-
-	for mopt in `echo $opts | sed -e s/,/\ /g`; do
-		case $mopt in
-		quota)
-			quotaopts="gu"
-			break
-			;;
-		usrquota)
-			quotaopts="u$quotaopts"
-			continue
-			;;
-		grpquota)
-			quotaopts="g$quotaopts"
-			continue
-			;;
-		noquota)
-			quotaopts=""
-			return 0
-			;;
-		esac
-	done
-
-	echo $quotaopts
-	return 0
-}
-
-
-
-#
-# Enable quotas on the mount point if the user requested them
-#
-enable_fs_quotas()
-{
-	declare -i need_check=0
-	declare -i rv
-	declare quotaopts=""
-	declare mopt
-	declare opts="$1"
-	declare mp="$2"
-
-	if ! type quotaon &> /dev/null; then
-		ocf_log err "quotaon not found in $PATH"
-		return $OCF_ERR_GENERIC
-	fi
-
-	quotaopts=$(quota_opts $opts)
-	[ -z "$quotaopts" ] && return 0
-
-	ocf_log debug "quotaopts = $quotaopts"
-
-	# Ok, create quota files if they don't exist
-	for f in quota.user aquota.user quota.group aquota.group; do
-		if ! [ -f "$mp/$f" ]; then
-			ocf_log info "$mp/$f was missing - creating"
-			touch "$mp/$f"
-			chmod 600 "$mp/$f"
-			need_check=1
-		fi
-	done
-
-	if [ $need_check -eq 1 ]; then
-		ocf_log info "Checking quota info in $mp"
-		quotacheck -$quotaopts "$mp"
-	fi
-
-	ocf_log info "Enabling Quotas on $mp"
-	ocf_log debug "quotaon -$quotaopts \"$mp\""
-	quotaon -$quotaopts "$mp"
-	rv=$?
-	if [ $rv -ne 0 ]; then
-		# Just a warning
-		ocf_log warn "Unable to turn on quotas for $mp; return = $rv"
-	fi
-
-	return $rv
-}
-
-
-# Agent-specific actions to take before mounting
-# (if required).  Typically things like fsck.
-do_pre_mount() {
-	return 0
-}
-
-# Default mount handler - for block devices
-#
-do_mount() {
-	declare dev="$1"
-	declare mp="$2"
-	declare mount_options=""
-	declare fstype_option=""
-	declare fstype
-
-	#
-	# Get the filesystem type, if specified.
-	#
-	fstype_option=""
-	fstype=${OCF_RESKEY_fstype}
-	case "$fstype" in
-	""|"[ 	]*")
-		fstype=""
-		;;
-	*)	# found it
-		fstype_option="-t $fstype"
-		;;
-	esac
-
-	#
-	# Get the mount options, if they exist.
-	#
-	mount_options=""
-	opts=${OCF_RESKEY_options}
-	case "$opts" in
-	""|"[ 	]*")
-		opts=""
-		;;
-	*)	# found it
-		mount_options="-o $opts"
-		;;
-	esac
-
-	#
-	# Mount the device
-	#
-	ocf_log info "mounting $dev on $mp"
-	ocf_log err "mount $fstype_option $mount_options $dev $mp"
-	mount $fstype_option $mount_options "$dev" "$mp"
-}
-
-
-# Agent-specific actions to take after mounting
-# (if required).
-do_post_mount() {
-	return 0
-}
-
-
-# Agent-specific actions to take before unmounting
-# (if required)
-do_pre_unmount() {
-	return 0
-}
-
-
-# Agent-specific actions to take after umount succeeds
-# (if required)
-do_post_unmount() {
-	return 0
-}
-
-
-# Agent-specific force-unmount logic, if required
-do_force_unmount() {
-	return 0
-}
-
-
-#
-# start_filesystem
-#
-start_filesystem() {
-	declare -i ret_val=$OCF_SUCCESS
-	declare mp="${OCF_RESKEY_mountpoint}"
-	declare dev=""			# device
-	declare fstype=""
-	declare opts=""
-	declare mount_options=""
-
-	#
-	# Check if mount point was specified.  If not, no need to continue.
-	#
-	case "$mp" in
-	""|"[ 	]*")		# nothing to mount
-		return $OCF_SUCCESS
-		;;
-	/*)			# found it
-		;;
-	*)			# invalid format
-			ocf_log err \
-"start_filesystem: Invalid mount point format (must begin with a '/'): \'$mp\'"
-		return $OCF_ERR_ARGS
-		;;
-	esac
-
-	#
-	# Get the device
-	#
-	real_device "$OCF_RESKEY_device"
-	dev="$REAL_DEVICE"
-	if [ -z "$dev" ]; then
-			ocf_log err "\
-start_filesystem: Could not match $OCF_RESKEY_device with a real device"
-			return $OCF_ERR_ARGS
-	fi
-
-	#
-	# Ensure we've got a valid directory
-	#
-	if [ -e "$mp" ]; then
-		if ! [ -d "$mp" ]; then
-			ocf_log err"\
-start_filesystem: Mount point $mp exists but is not a directory"
-			return $OCF_ERR_ARGS
-		fi
-	else
-		ocf_log err "\
-start_filesystem: Creating mount point $mp for device $dev"
-		mkdir -p "$mp"
-		ret_val=$?
-		if [ $ret_val -ne 0 ]; then
-			ocf_log err "\
-start_filesystem: Unable to create $mp.  Error code: $ret_val"
-			return $OCF_ERR_GENERIC
-		fi
-	fi
-
-	#
-	# See if the device is already mounted.
-	#
-	is_mounted "$dev" "$mp"
-	case $? in
-	$YES)		# already mounted
-		ocf_log debug "$dev already mounted"
-		return $OCF_SUCCESS
-		;;
-	$NO)		# not mounted, continue
-		;;
-	*)
-		return $FAIL
-		;;
-	esac
-
-
-	#
-	# Make sure that neither the device nor the mount point are mounted
-	# (i.e. they may be mounted in a different location).  The'mount_in_use'
-	# function checks to see if either the device or mount point are in
-	# use somewhere else on the system.
-	#
-	mount_in_use "$dev" "$mp"
-	case $? in
-	$YES)		# uh oh, someone is using the device or mount point
-		ocf_log err "\
-Cannot mount $dev on $mp, the device or mount point is already in use!"
-		return $FAIL
-		;;
-	$NO)		# good, no one else is using it
-		;;
-	$FAIL)
-		return $FAIL
-		;;
-	*)
-		ocf_log err "Unknown return from mount_in_use"
-		return $FAIL
-		;;
-	esac
-
-	do_pre_mount
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	do_mount "$dev" "$mp"
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	do_post_mount
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	enable_fs_quotas "$opts" "$mp"
-
-	return $OCF_SUCCESS
-}
-
-
-#
-# stop_filesystem - unmount a file system; calls out to
-#
-stop_filesystem() {
-	declare -i ret_val=0
-	declare -i try
-	declare -i sleep_time=5		# time between each umount failure
-	declare umount_failed=""
-	declare force_umount=""
-	declare self_fence=""
-	declare quotaopts=""
-
-	#
-	# Get the mount point, if it exists.  If not, no need to continue.
-	#
-	mp=${OCF_RESKEY_mountpoint}
-	case "$mp" in
-	""|"[ 	]*")		# nothing to mount
-		return $OCF_SUCCESS
-		;;
-	/*)			# found it
-		;;
-	*)		# invalid format
-			ocf_log err \
-"stop_filesystem: Invalid mount point format (must begin with a '/'): \'$mp\'"
-		return $FAIL
-		;;
-	esac
-
-	#
-	# Get the device
-	#
-	real_device "$OCF_RESKEY_device"
-	dev="$REAL_DEVICE"
-	if [ -z "$dev" ]; then
-			ocf_log err "\
-stop: Could not match $OCF_RESKEY_device with a real device"
-			return $FAIL
-	fi
-
-	#
-	# Get the force unmount setting if there is a mount point.
-	#
-	case ${OCF_RESKEY_force_unmount} in
-        $YES_STR)	force_umount=$YES ;;
-	on)		force_umount=$YES ;;
-	true)		force_umount=$YES ;;
-	1)		force_umount=$YES ;;
-        *)		force_umount="" ;;
-	esac
-
-	case ${OCF_RESKEY_self_fence} in
-        $YES_STR)	self_fence=$YES ;;
-	on)		self_fence=$YES ;;
-	true)		self_fence=$YES ;;
-	1)		self_fence=$YES ;;
-        *)		self_fence="" ;;
-	esac
-
-	do_pre_unmount
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	#
-	# Preparations: sync, turn off quotas
-	#
-	sync
-
-	quotaopts=$(quota_opts $OCF_RESKEY_options)
-	if [ -n "$quotaopts" ]; then
-		ocf_log debug "Turning off quotas for $mp"
-		quotaoff -$quotaopts "$mp" &> /dev/null
-	fi
-
-	#
-	# Unmount the device.
-	#
-	for try in 1 2 3; do
-		if [ $try -ne 1 ]; then
-			sleep $sleep_time
-		fi
-
-		is_mounted "$dev" "$mp"
-		case $? in
-		$NO)
-			ocf_log info "$dev is not mounted"
-			umount_failed=
-			break
-			;;
-		$YES)	# fallthrough
-			;;
-		*)
-			return $FAIL
-			;;
-		esac
-
-		ocf_log info "unmounting $mp"
-		umount "$mp"
-		ret_val=$?
-		if  [ $ret_val -eq 0 ]; then
-			umount_failed=
-			break
-		fi
-
-		ocf_log debug "umount failed: $ret_val"
-		umount_failed=yes
-
-		if [ -z "$force_umount" ]; then
-			continue
-		fi
-
-		# Force unmount: try #1: send SIGTERM
-		if [ $try -eq 1 ]; then
-			ocf_log warning "Sending SIGTERM to processes on $mp"
-			fuser -TERM -kvm "$mp"
-			continue
-		else
-			ocf_log warning "Sending SIGKILL to processes on $mp"
-			fuser -kvm "$mp"
-
-			do_force_unmount
-			case $? in
-			0)
-				;;
-			1)
-				return $OCF_ERR_GENERIC
-				;;
-			2)
-				break
-				;;
-			esac
-		fi
-	done # for
-
-	do_post_unmount
-	case $? in
-	0)
-		;;
-	1)
-		return $OCF_ERR_GENERIC
-		;;
-	2)
-		return $OCF_SUCCESS
-		;;
-	esac
-
-	if [ -n "$umount_failed" ]; then
-		ocf_log err "'umount $mp' failed, error=$ret_val"
-
-		if [ "$self_fence" ]; then
-			ocf_log alert "umount failed - REBOOTING"
-			sync
-			reboot -fn
-		fi
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $OCF_SUCCESS
-}
-
-
-do_start() {
-	declare tries=0
-	declare rv
-
-	while [ $tries -lt 3 ]; do
-		start_filesystem
-		rv=$?
-		if [ $rv -eq 0 ]; then
-			return 0
-		fi
-
-		((tries++))
-		sleep 3
-	done
-	return $rv
-}
-
-
-do_stop() {
-	stop_filesystem
-	return $?
-}
-
-
-do_monitor() {
-	is_mounted "${OCF_RESKEY_device}" "${OCF_RESKEY_mountpoint}"
-
-	if [ $? -ne $YES ]; then
-		ocf_log err "${OCF_RESOURCE_INSTANCE}: ${OCF_RESKEY_device} is not mounted on ${OCF_RESKEY_mountpoint}"
-		return $OCF_NOT_RUNNING
-	fi
-
-	if [ "$OCF_RESKEY_quick_status" = "1" ]; then
-		return 0
-	fi
-
-	is_alive "${OCF_RESKEY_mountpoint}"
-	[ $? -eq $YES ] && return 0
-
-	ocf_log err "fs:${OCF_RESKEY_name}: Mount point is not accessible!"
-	return $OCF_ERR_GENERIC
-}
-
-
-do_restart() {
-	stop_filesystem
-	if [ $? -ne 0 ]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	start_filesystem
-	if [ $? -ne 0 ]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	return 0
-}
-
-
-# MUST BE OVERRIDDEN
-do_metadata() {
-	return 1
-}
-
-
-do_validate() {
-	return 1
-}
-
-
-main() {
-	case $1 in
-	start)
-		do_start
-		exit $?
-		;;
-	stop)
-		do_stop
-		exit $?
-		;;
-	status|monitor)
-		do_monitor
-		exit $?
-		;;
-	restart)
-		do_restart
-		exit $?
-		;;
-	meta-data)
-		do_metadata
-		exit $?
-		;;
-	validate-all)
-		do_validate
-		;;
-	*)
-		echo "usage: $0 {start|stop|status|monitor|restart|meta-data|validate-all}"
-		exit $OCF_ERR_UNIMPLEMENTED
-		;;
-	esac
-	exit 0
-}
-
diff --git a/rgmanager/src/resources/utils/httpd-parse-config.pl b/rgmanager/src/resources/utils/httpd-parse-config.pl
deleted file mode 100644
index 26ef378..0000000
--- a/rgmanager/src/resources/utils/httpd-parse-config.pl
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/perl -w
-
-##
-##  This script removes <IfDefine foo> sections from the
-##  Apache httpd.conf file. This is quite useful because we
-##  don't have any direct access to the parsed configuration
-##  file of the httpd server.
-##
-##  Usage: ./httpd-parse-config.pl -Dfoo1 -Dfoo2 < httpd.conf
-##         where fooX are defines as passed to the httpd server
-##
-##  Note:  All whitespace characters at the beginning and end 
-##         of lines are removed.
-##
-use strict;
-
-my @defines = ();
-## Default behaviour is to show all lines when we are not
-## in the <IfDefine foo> sections.
-my @show = (1);
-
-sub testIfDefine($) {
-	my $param = $1;
-	my $positiveTest = 1;
-	if ($param =~ /^!(.*)$/) {
-		$param = $1;
-		$positiveTest = 0;
-	}
-
-	foreach my $def (@defines) {
-		if ($def eq $param) {
-			return $positiveTest;
-		}
-	}
-
-	return (1-$positiveTest);	
-}
-
-foreach my $arg (@ARGV) {
-	if ($arg =~ /^-D(.*)$/) {
-		push(@defines, $1);
-	}
-}
-
-## Parse config file and remove IfDefine sections 
-while (my $line = <STDIN>) {
-	chomp($line);
-	$line =~ s/^\s*(.*?)\s*$/$1/;
-	if ($line =~ /<IfDefine (.*)>/) {
-		if (testIfDefine($1) == 1) {
-			if ($show[$#show] == 1) {
-				push (@show, 1);
-			} else {
-				push (@show, 0);
-			}
-		} else {
-			push (@show, 0);
-		}
-	} elsif ($line =~ /<\/IfDefine>/) {
-		pop(@show);
-	} elsif ($show[$#show] == 1) {
-		print $line, "\n";
-	}
-}
-
diff --git a/rgmanager/src/resources/utils/member_util.sh b/rgmanager/src/resources/utils/member_util.sh
deleted file mode 100644
index f9a0906..0000000
--- a/rgmanager/src/resources/utils/member_util.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-
-#
-# Use clustat to figure out if the specified node is a member
-# of the cluster.  Returns 2 if not found, 1 if not a member, and
-# 0 if the node is happily running.
-# Tested on RHEL4 and RHEL5; requires RHCS 5.1 or 4.5 to operate
-# properly in all cases.
-#
-is_node_member_clustat()
-{
-	declare line=$(clustat -xm $1 | grep "name=\"$1\"")
-	declare tmp
-
-	# Done if there's no node in the list with that name: not a 
-	# cluster member, and not in the configuration.
-	[ -n "$line" ] || return 2
-
-	# Clear out xml tag seps.
-	line=${line/*</}
-	line=${line/\/>/}
-
-	# Make vars out of XML attributes.
-	for tmp in $line; do
-		eval declare __$tmp
-	done
-
-	# Flip the value.  clustat reports 1 for member, 0 for not;
-	# Exactly the opposite of what a shell script expects.
-	((__state = !__state))
-	return $__state
-}
-
-
-#
-# Print the local node name to stdout
-# Returns 0 if could be found, 1 if not
-# Tested on RHEL4 (magma) and RHEL5 (cman)
-#
-local_node_name()
-{
-	declare node state line
-
-	if which magma_tool &> /dev/null; then
-		# Use magma_tool, if available.
-		line=$(magma_tool localname | grep "^Local")
-
-		if [ -n "$line" ]; then
-			echo ${line/* = /}
-			return 0
-		fi
-	fi
-
-	if ! which cman_tool &> /dev/null; then
-		# No cman tool? :(
-		return 2
-	fi
-
-	# Use cman_tool
-
-	line=$(cman_tool status | grep -i "Node name: $1")
-	[ -n "$line" ] || return 1
-	echo ${line/*name: /}
-	return 0
-}
-
diff --git a/rgmanager/src/resources/utils/messages.sh b/rgmanager/src/resources/utils/messages.sh
deleted file mode 100644
index 9381f1f..0000000
--- a/rgmanager/src/resources/utils/messages.sh
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/bin/bash
-
-declare CLOG_INIT=100
-declare CLOG_SUCCEED=200
-declare CLOG_SUCCEED_KILL=201
-
-declare CLOG_FAILED=400
-declare CLOG_FAILED_TIMEOUT=401
-declare CLOG_FAILED_NOT_FOUND=403
-declare CLOG_FAILED_INVALID=404
-declare CLOG_FAILED_NOT_READABLE=405
-declare CLOG_FAILED_KILL=406
-
-##
-## Usage:
-##	clog_service_start %operation%
-##
-clog_service_start()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log info "Starting Service $OCF_RESOURCE_INSTANCE"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Starting Service $OCF_RESOURCE_INSTANCE > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Starting Service $OCF_RESOURCE_INSTANCE > Failed"
-			;;
-		$CLOG_FAILED_TIMEOUT)
-			ocf_log error "Starting Service $OCF_RESOURCE_INSTANCE > Failed - Timeout Error"
-			;;
-	esac
-	return 0
-}
-
-##
-## Usage:
-##	clog_service_stop %operation%
-##
-clog_service_stop()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log info "Stopping Service $OCF_RESOURCE_INSTANCE"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log info "Stopping Service $OCF_RESOURCE_INSTANCE > Succeed"
-			;;
-		$CLOG_SUCCEED_KILL)
-			ocf_log info "Killing Service $OCF_RESOURCE_INSTANCE > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Stopping Service $OCF_RESOURCE_INSTANCE > Failed"
-			;;
-		$CLOG_FAILED_NOT_STOPPED)
-			ocf_log error "Stopping Service $OCF_RESOURCE_INSTANCE > Failed - Application Is Still Running"
-			;;
-		$CLOG_FAILED_KILL)
-			ocf_log error "Killing Service $OCF_RESOURCE_INSTANCE > Failed"
-			;;
-	esac
-	return 0
-}
-
-##
-## Usage:
-##	clog_service_status %operation%
-##
-clog_service_status()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Monitoring Service $OCF_RESOURCE_INSTANCE"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Monitoring Service $OCF_RESOURCE_INSTANCE > Service Is Running"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Monitoring Service $OCF_RESOURCE_INSTANCE > Service Is Not Running"
-			;;
-		$CLOG_FAILED_NOT_FOUND)
-			ocf_log error "Monitoring Service $OCF_RESOURCE_INSTANCE > Service Is Not Running - PID File Not Found"
-			;;
-	esac
-	return 0
-}
-
-##
-## Usage:
-##	clog_service_verify %operation%
-##	clog_service_verify $CLOG_FAILED %reason%
-##
-clog_service_verify()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Verifying Configuration Of $OCF_RESOURCE_INSTANCE"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Verifying Configuration Of $OCF_RESOURCE_INSTANCE > Succeed"
-			;;
-		$CLOG_FAILED_NOT_CHILD)
-			ocf_log error "Service $OCF_RESOURCE_INSTANCE Is Not A Child Of A Service"
-			;;
-		$CLOG_FAILED)
-			if [ "x$2" = "x" ]; then
-				ocf_log error "Verifying Configuration Of $OCF_RESOURCE_INSTANCE > Failed"
-			else
-				ocf_log error "Verifying Configuration Of $OCF_RESOURCE_INSTANCE > Failed - $2"
-			fi
-			;;
-	esac
-	return 0
-}
-
-
-##
-## Usage:
-##	clog_check_sha1 %operation% %filename%
-##
-clog_check_sha1()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Checking SHA1 Checksum Of File $1"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Checking SHA1 Checksum Of File > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log debug "Checking SHA1 Checksum Of File > Failed - File Changed"
-			;;
-	esac
-	return 0;
-} 
-
-##
-## Usage:
-##	clog_check_file_exist %operation% %filename%
-##
-clog_check_file_exist()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Checking Existence Of File $2"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Checking Existence Of File $2 > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Checking Existence Of File $2 [$OCF_RESOURCE_INSTANCE] > Failed"
-			;;
-		$CLOG_FAILED_INVALID)
-			ocf_log error "Checking Existence Of File $2 [$OCF_RESOURCE_INSTANCE] > Failed - Invalid Argument"
-			;;
-		$CLOG_FAILED_NOT_FOUND)
-			ocf_log error "Checking Existence Of File $2 [$OCF_RESOURCE_INSTANCE] > Failed - File Doesn't Exist"
-			;;
-		$CLOG_FAILED_NOT_READABLE)
-			ocf_log error "Checking Existence Of File $2 [$OCF_RESOURCE_INSTANCE] > Failed - File Is Not Readable"
-			;;
-	esac
-	return 0;
-} 
-
-##
-## Usage:
-##	clog_check_pid %operation% %filename%
-##
-clog_check_pid()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Checking Non-Existence Of PID File $2"
-			return 0
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Checking Non-Existence of PID File $2 > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Checking Non-Existence of PID File $2 [$OCF_RESOURCE_INSTANCE] > Failed - PID File Exists For $OCF_RESOURCE_INSTANCE"
-			;;
-	esac
-	return 0;
-}
-
-##
-## Usage:
-##	clog_check_syntax %operation% %filename%
-##
-clog_check_syntax()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Checking Syntax Of The File $2"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Checking Syntax Of The File $2 > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Checking Syntax Of The File $2 [$OCF_RESOURCE_INSTANCE] > Failed"
-			;;		
-	esac
-	return 0;
-}
-
-##
-## Usage:
-##	clog_generate_config %operation% %old filename% %new filename%
-##
-clog_generate_config()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Generating New Config File $3 From $2"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Generating New Config File $3 From $2 > Succeed"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Generating New Config File $3 From $2 [$OCF_RESOURCE_INSTANCE] > Failed"
-			;;		
-	esac
-	return 0;
-}
-
-##
-## Usage:
-##	clog_looking_for %operation% %resource%
-##	clog_looking_for %operation% "IP Addresses"
-##	clog_looking_for %operation% "Filesystems"
-##
-clog_looking_for()
-{
-	case $1 in
-		$CLOG_INIT)
-			ocf_log debug "Looking For $2"
-			;;
-		$CLOG_SUCCEED)
-			ocf_log debug "Looking For $2 > Succeed - $3 $2 Found"
-			;;
-		$CLOG_FAILED)
-			ocf_log error "Looking For $2 [$OCF_RESOURCE_INSTANCE] > Failed"
-			;;		
-		$CLOG_FAILED_NOT_FOUND)
-			ocf_log error "Looking For $2 [$OCF_RESOURCE_INSTANCE] > Failed - No $2 Found"
-			;;		
-	esac
-	return 0;
-}
diff --git a/rgmanager/src/resources/utils/named-parse-config.pl b/rgmanager/src/resources/utils/named-parse-config.pl
deleted file mode 100644
index 7a8b2dd..0000000
--- a/rgmanager/src/resources/utils/named-parse-config.pl
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/perl -w
-
-##
-##  Parse named.conf (from STDIN) and add options from cluster.conf
-##  
-##  ./named-parse-config.pl "directory" "pid-file" "listen-on"
-##
-use strict;
-
-if ($#ARGV < 2) {
-	die ("Not enough arguments");
-}
-
-while (my $line = <STDIN>) {
-	chomp($line);
-	$line =~ s/(.*?)\s*$/$1/;
-	if ($line =~ /^\s*options\s+\{/) {
-		print $line, "\n";
-		print "\tdirectory \"$ARGV[0]\";\n";
-		print "\tpid-file \"$ARGV[1]\";\n";
-		print "\tlisten-on { $ARGV[2] };\n";
-	} else {
-		print $line, "\n";
-	}
-}
-
diff --git a/rgmanager/src/resources/utils/ra-skelet.sh b/rgmanager/src/resources/utils/ra-skelet.sh
deleted file mode 100644
index 5de7bb2..0000000
--- a/rgmanager/src/resources/utils/ra-skelet.sh
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/bash
-
-status_check_pid()
-{
-	declare pid_file="$1"
-
-	if [ -z "$pid_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_INVALID "$pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	if [ ! -e "$pid_file" ]; then
-		clog_check_file_exist $CLOG_FAILED "$pid_file"
-		return $OCF_ERR_GENERIC
-	fi
-
-	read pid < "$pid_file"
-	
-	if [ -z "$pid" ]; then
-		return $OCF_ERR_GENERIC
-	fi
-	
-	if [ ! -d /proc/$pid ]; then
-		return $OCF_ERR_GENERIC
-	fi	
-
-	return 0
-}
-
-stop_generic()
-{
-	declare pid_file="$1"
-	declare stop_timeout="$2"
-	declare pid;
-	declare count=0;
-
-	if [ ! -e "$pid_file" ]; then
-		clog_check_file_exist $CLOG_FAILED_NOT_FOUND "$pid_file"
-		# In stop-after-stop situation there is no PID file but
-		# it will be nice to check for it in stop-after-start
-		# look at bug #449394
-		return 0
-	fi
-
-	if [ -z "$stop_timeout" ]; then
-		stop_timeout=20
-	fi
-
-	read pid < "$pid_file"
-
-	# @todo: PID file empty -> error?
-	if [ -z "$pid" ]; then
-		return 0;
-	fi
-
-	# @todo: PID is not running -> error?
-	if [ ! -d "/proc/$pid" ]; then
-		return 0;
-	fi
-
-	kill -TERM "$pid"
-
-	if [ $? -ne 0 ]; then
-		return $OCF_ERR_GENERIC
-	fi
-
-	until [ `ps --pid "$pid" &> /dev/null; echo $?` = '1' ] || [ $count -gt $stop_timeout ]
-	do
-		sleep 1
-		let count=$count+1
-	done
-
-	if [ $count -gt $stop_timeout ]; then
-		clog_service_stop $CLOG_FAILED_NOT_STOPPED
-		return $OCF_ERR_GENERIC
-	fi
-	
-	return 0;
-}
-
-stop_generic_sigkill() {
-	# Use stop_generic (kill -TERM) and if application did not stop
-	# correctly then use kill -QUIT and check if it was killed
-	declare pid_file="$1"
-	declare stop_timeout="$2"
-	declare kill_timeout="$3"
-	declare pid
-	
-	stop_generic "$pid_file" "$stop_timeout"
-	if [ $? -eq 0 ]; then
-		return 0;
-	fi
-	
-	read pid < "$pid_file"
-	kill -QUIT "$pid"
-	if [ $? -ne 0 ]; then
-		return $OCF_GENERIC_ERROR
-	fi
-	
-	sleep "$kill_timeout"
-	ps --pid "$psql_pid" &> /dev/null
-	if [ $? -eq 0 ]; then
-		clog_service_stop $CLOG_FAILED_KILL
-		return $OCF_ERR_GENERIC
-	fi
-	
-	clog_service_stop $CLOG_SUCCEED_KILL
-	return 0
-}
diff --git a/rgmanager/src/resources/utils/tomcat-parse-config.pl b/rgmanager/src/resources/utils/tomcat-parse-config.pl
deleted file mode 100644
index 109ecae..0000000
--- a/rgmanager/src/resources/utils/tomcat-parse-config.pl
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl -w
-
-##
-##  This script replace IP addresses on which tomcat server
-##  should listen. Tomcat can't listen on every IP because that 
-##  way we can run only on instance. 
-##
-##  Usage: ./tomcat-parse-config.pl ip1 ip2 < /etc/tomcat/server.xml
-##         where ipXX defines an IP address [eg. 127.0.0.1 134.45.11.1]
-##
-##
-use strict;
-
-while (my $line = <STDIN>) {
-	chomp ($line);
-
-	if ($line =~ /(.*?)<Connector (.*)/) {
-		my $tmp = $2;
-		my $content = "<Connector ";
-		my $start = $1;
-		my $rest = "";
-
-		while (($tmp =~ />/) == 0) {
-			$content .= $tmp . "\n";
-			$tmp = <STDIN>;
-			chomp($tmp);
-		}
-
-		if ($tmp =~ /(.*?)>(.*)/) {
-			$content .= $1 . ">\n";
-			$rest = $2;
-			chomp($rest);
-		}
-		
-		print $start;
-		foreach my $arg (@ARGV) {
-			$content =~ s/\s+address=".*?"/ /;
-			$content =~ s/Connector /Connector address="$arg" /;
-			print $content;
-		}
-		print $rest;
-	} else {
-		print $line,"\n";
-	}
-}
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
deleted file mode 100644
index e23d5ba..0000000
--- a/rgmanager/src/resources/vm.sh
+++ /dev/null
@@ -1,1066 +0,0 @@
-#!/bin/bash
-
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-export PATH
-
-. $(dirname $0)/ocf-shellfuncs || exit 1
-
-#
-# Virtual Machine start/stop script (requires the virsh command)
-#
-
-# Indeterminate state: xend/libvirtd is down.
-export OCF_APP_ERR_INDETERMINATE=150
-
-meta_data()
-{
-    cat <<EOT
-<?xml version="1.0"?>
-<resource-agent version="rgmanager 2.0" name="vm">
-    <version>1.0</version>
-
-    <longdesc lang="en">
-	Defines a Virtual Machine
-    </longdesc>
-    <shortdesc lang="en">
-        Defines a Virtual Machine
-    </shortdesc>
-
-    <parameters>
-        <parameter name="name" primary="1">
-            <longdesc lang="en">
-                This is the name of the virtual machine.
-            </longdesc>
-            <shortdesc lang="en">
-                Name
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-    
-        <parameter name="domain" reconfig="1">
-            <longdesc lang="en">
-                Failover domains define lists of cluster members
-                to try in the event that the host of the virtual machine
-		fails.
-            </longdesc>
-            <shortdesc lang="en">
-                Cluster failover Domain
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="autostart" reconfig="1">
-            <longdesc lang="en">
-	    	If set to yes, this resource group will automatically be started
-		after the cluster forms a quorum.  If set to no, this virtual
-		machine will start in the 'disabled' state after the cluster
-		forms a quorum.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Automatic start after quorum formation
-            </shortdesc>
-            <content type="boolean" default="1"/>
-        </parameter>
-
-        <parameter name="exclusive" reconfig="1">
-            <longdesc lang="en">
-	    	If set, this resource group will only relocate to
-		nodes which have no other resource groups running in the
-		event of a failure.  If no empty nodes are available,
-		this resource group will not be restarted after a failure.
-		Additionally, resource groups will not automatically
-		relocate to the node running this resource group.  This
-		option can be overridden by manual start and/or relocate
-		operations.
-            </longdesc>
-            <shortdesc lang="en">
-	        Exclusive resource group
-            </shortdesc>
-            <content type="boolean" default="0"/>
-        </parameter>
-
-        <parameter name="recovery" reconfig="1">
-            <longdesc lang="en">
-	        This currently has three possible options: "restart" tries
-		to restart this virtual machine locally before
-		attempting to relocate (default); "relocate" does not bother
-		trying to restart the VM locally; "disable" disables
-		the VM if it fails.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Failure recovery policy
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-       <parameter name="migration_mapping" reconfig="1">
-           <longdesc lang="en">
-               Mapping of the hostname of a target cluster member to a different hostname
-           </longdesc>
-           <shortdesc lang="en">
-               memberhost:targethost,memberhost:targethost ..
-           </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-	<parameter name="use_virsh">
-	    <longdesc lang="en">
-	    	Force use of virsh instead of xm on Xen machines.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	If set to 1, vm.sh will use the virsh command to manage
-		virtual machines instead of xm.  This is required when
-		using non-Xen virtual machines (e.g. qemu / KVM).
-	    </shortdesc>
-            <content type="integer" default=""/>
-        </parameter>
-
-	<parameter name="xmlfile">
-	    <longdesc lang="en">
-	    	Full path to libvirt XML file describing the domain.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	Full path to libvirt XML file describing the domain.
-	    </shortdesc>
-            <content type="string"/>
-	</parameter>
-
-	<parameter name="migrate">
-	    <longdesc lang="en">
-	    	Migration type (live or pause, default = live).
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	Migration type (live or pause, default = live).
-	    </shortdesc>
-            <content type="string" default="live"/>
-        </parameter>
-
-	<parameter name="path">
-	    <longdesc lang="en">
-		Path specification vm.sh will search for the specified
- 		VM configuration file.  /path1:/path2:...
-	    </longdesc>
-	    <shortdesc lang="en">
-		Path to virtual machine configuration files.
- 	    </shortdesc>
-	    <content type="string"/>
- 	</parameter>
-
-	<parameter name="snapshot">
-	    <longdesc lang="en">
-	    	Path to the snapshot directory where the virtual machine
-		image will be stored.
-	    </longdesc>
-	    <shortdesc lang="en">
-	    	Path to the snapshot directory where the virtual machine
-		image will be stored.
-	    </shortdesc>
-            <content type="string" default=""/>
-        </parameter>
-
-        <parameter name="depend">
-            <longdesc lang="en">
-		Service dependency; will not start without the specified
-		service running.
-            </longdesc>
-            <shortdesc lang="en">
-		Top-level service this depends on, in service:name format.
-            </shortdesc>
-            <content type="string"/>
-        </parameter>
-
-        <parameter name="depend_mode">
-            <longdesc lang="en">
-		Service dependency mode.
-		hard - This service is stopped/started if its dependency
-		       is stopped/started
-		soft - This service only depends on the other service for
-		       initial startip.  If the other service stops, this
-		       service is not stopped.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Service dependency mode (soft or hard).
-            </shortdesc>
-            <content type="string" default="hard"/>
-        </parameter>
-
-        <parameter name="max_restarts" reconfig="1">
-            <longdesc lang="en">
-	    	Maximum restarts for this service.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Maximum restarts for this service.
-            </shortdesc>
-            <content type="string" default="0"/>
-        </parameter>
-
-        <parameter name="restart_expire_time" reconfig="1">
-            <longdesc lang="en">
-	    	Restart expiration time.  A restart is forgotten
-		after this time.  When combined with the max_restarts
-		option, this lets administrators specify a threshold
-		for when to fail over services.  If max_restarts
-		is exceeded in this given expiration time, the service
-		is relocated instead of restarted again.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Restart expiration time; amount of time before a restart
-		is forgotten.
-            </shortdesc>
-            <content type="string" default="0"/>
-        </parameter>
-
-        <parameter name="status_program" reconfig="1">
-            <longdesc lang="en">
-	    	Ordinarily, only the presence/health of a virtual machine
-		is checked.  If specified, the status_program value is
-		executed during a depth 10 check.  The intent of this 
-		program is to ascertain the status of critical services
-		within a virtual machine.
-            </longdesc>
-            <shortdesc lang="en">
-	    	Additional status check program
-            </shortdesc>
-            <content type="string" default=""/>
-        </parameter>
-
-	<parameter name="hypervisor">
-            <shortdesc lang="en">
-		Hypervisor
-            </shortdesc >
-            <longdesc lang="en">
-		Specify hypervisor tricks to use.  Default = auto.
-		Other supported options are xen and qemu.
-            </longdesc>
-	    <content type="string" default="auto" />
-	</parameter>
-
-	<parameter name="hypervisor_uri">
-            <longdesc lang="en">
-		Hypervisor URI.  Generally, this is keyed off of the
-		hypervisor and does not need to be set.
-            </longdesc>
-            <shortdesc lang="en">
-		Hypervisor URI (normally automatic).
-            </shortdesc >
-	    <content type="string" default="auto" />
-	</parameter>
-
-	<parameter name="migration_uri">
-            <longdesc lang="en">
-		Migration URI.  Generally, this is keyed off of the
-		hypervisor and does not need to be set.
-            </longdesc>
-            <shortdesc lang="en">
-		Migration URI (normally automatic).
-            </shortdesc >
-	    <content type="string" default="auto" />
-	</parameter>
-
-    </parameters>
-
-    <actions>
-        <action name="start" timeout="300"/>
-        <action name="stop" timeout="120"/>
-	
-        <action name="status" timeout="10" interval="30"/>
-        <action name="monitor" timeout="10" interval="30"/>
-
-	<!-- depth 10 calls the status_program -->
-        <action name="status" depth="10" timeout="20" interval="60"/>
-        <action name="monitor" depth="10" timeout="20" interval="60"/>
-
-	<!-- reconfigure - reconfigure with new OCF parameters.
-	     NOT OCF COMPATIBLE AT ALL -->
-	<action name="reconfig" timeout="10"/>
-
-	<action name="migrate" timeout="10m"/>
-
-        <action name="meta-data" timeout="5"/>
-        <action name="validate-all" timeout="5"/>
-
-    </actions>
-    
-    <special tag="rgmanager">
-    	<!-- Destroy_on_delete / init_on_add are currently only
-	     supported for migratory resources (no children
-	     and the 'migrate' action; see above.  Do not try this
-	     with normal services -->
-        <attributes maxinstances="1" destroy_on_delete="0" init_on_add="0"/>
-    </special>
-</resource-agent>
-EOT
-}
-
-
-build_virsh_cmdline()
-{
-	declare cmdline=""
-	declare operation=$1
-
-	if [ -n "$OCF_RESKEY_hypervisor_uri" ]; then
-		cmdline="$cmdline -c $OCF_RESKEY_hypervisor_uri"
-	fi
-
-	cmdline="$cmdline $operation $OCF_RESKEY_name"
-		
-	echo $cmdline
-}
-
-
-# this is only used on startup
-build_xm_cmdline()
-{
-	declare operation=$1
-	#
-	# Virtual domains should never restart themselves when 
-	# controlled externally; the external monitoring app
-	# should.
-	#
-	declare cmdline="on_shutdown=\"destroy\" on_reboot=\"destroy\" on_crash=\"destroy\""
-
-	if [ -n "$OCF_RESKEY_path" ]; then
-		operation="$operation --path=\"$OCF_RESKEY_path\""
-	fi
-
-	if [ -n "$OCF_RESKEY_name" ]; then
-		cmdline="$operation $OCF_RESKEY_name $cmdline"
-	fi
-
-	echo $cmdline
-}
-
-
-do_xm_start()
-{
-	# Use /dev/null for the configuration file, if xmdefconfig
-	# doesn't exist...
-	#
-	declare cmdline
-
-	echo -n "Virtual machine $OCF_RESKEY_name is "
-	do_status && return 0
-
-	cmdline="`build_xm_cmdline create`"
-
-	ocf_log debug "xm $cmdline"
-
-	eval xm $cmdline
-	return $?
-}
-
-
-get_timeout()
-{
-	declare -i default_timeout=60
-	declare -i tout=60
-
-	if [ -n "$OCF_RESKEY_RGMANAGER_meta_timeout" ]; then
-		tout=$OCF_RESKEY_RGMANAGER_meta_timeout
-	elif [ -n "$OCF_RESKEY_CRM_meta_timeout" ]; then
-		tout=$OCF_RESKEY_CRM_meta_timeout
-	fi
-
-	if [ $tout -eq 0 ]; then
-		echo $default_timeout
-		return 0
-	fi
-	if [ $tout -lt 0 ]; then
-		echo $default_timeout
-		return 0
-	fi
-
-	echo $tout
-	return 0
-}
-
-
-#
-# Start a virtual machine given the parameters from
-# the environment.
-#
-do_virsh_start()
-{
-	declare cmdline
-	declare snapshotimage
-
-	echo -n "Virtual machine $OCF_RESKEY_name is "
-	do_status && return 0
-
-	snapshotimage="$OCF_RESKEY_snapshot/$OCF_RESKEY_name"
-
-        if [ -n "$OCF_RESKEY_snapshot" -a -f "$snapshotimage" ]; then
-		eval virsh restore $snapshotimage
-		if [ $? -eq 0 ]; then
-			rm -f $snapshotimage
-			return 0
-		fi
-		return 1
-	fi
-
-	if [ -n "$OCF_RESKEY_xmlfile" -a -f "$OCF_RESKEY_xmlfile" ]; then
-		# TODO: try to use build_virsh_cmdline for the hypervisor_uri
-		cmdline="virsh create $OCF_RESKEY_xmlfile"
-	else
-		cmdline="virsh $(build_virsh_cmdline start)"
-	fi
-
-	ocf_log debug "$cmdline"
-
-	$cmdline
-	return $?
-}
-
-
-do_xm_stop()
-{
-	declare -i timeout=60
-	declare -i ret=1
-	declare st
-
-	for op in $*; do
-		echo "CMD: xm $op $OCF_RESKEY_name"
-		xm $op $OCF_RESKEY_name
-
-		timeout=60
-		while [ $timeout -gt 0 ]; do
-			sleep 5
-			((timeout -= 5))
-			do_status&>/dev/null || return 0
-			while read dom state; do
-				#
-				# State is "stopped".  Kill it.
-				#
-				if [ "$dom" != "$OCF_RESKEY_name" ]; then
-					continue
-				fi
-				if [ "$state" != "---s-" ]; then
-					continue
-				fi
-				xm destroy $OCF_RESKEY_name
-			done < <(xm list | awk '{print $1, $5}')
-		done
-	done
-
-	return 1
-}
-
-
-#
-# Stop a VM.  Try to shut it down.  Wait a bit, and if it
-# doesn't shut down, destroy it.
-#
-do_virsh_stop()
-{
-	declare -i timeout=$(get_timeout)
-	declare -i ret=1
-	declare state
-
-	state=$(do_status)
-	[ $? -eq 0 ] || return 0
-
-	if [ -n "$OCF_RESKEY_snapshot" ]; then
-		virsh save $OCF_RESKEY_name "$OCF_RESKEY_snapshot/$OCF_RESKEY_name"
-	fi
-
-	for op in $*; do
-		echo virsh $op $OCF_RESKEY_name ...
-		virsh $op $OCF_RESKEY_name
-
-		timeout=$(get_timeout)
-		while [ $timeout -gt 0 ]; do
-			sleep 5
-			((timeout -= 5))
-			state=$(do_status)
-			[ $? -eq 0 ] || return 0
-
-			if [ "$state" = "paused" ]; then
-				virsh destroy $OCF_RESKEY_name
-			fi
-		done
-	done
-
-	return 1
-}
-
-
-do_start()
-{
-	if [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-		do_virsh_start $*
-		return $?
-	fi
-
-	do_xm_start $*
-	return $?
-}
-
-
-do_stop()
-{
-	declare domstate rv
-
-	domstate=$(do_status)
-	rv=$?
-	ocf_log debug "Virtual machine $OCF_RESKEY_name is $domstate"
-	if [ $rv -eq $OCF_APP_ERR_INDETERMINATE ]; then
-		ocf_log crit "xend/libvirtd is dead; cannot stop $OCF_RESKEY_name"
-		return 1
-	fi
-
-	if [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-		do_virsh_stop $*
-		return $?
-	fi
-
-	do_xm_stop $*
-	return $?
-}
-
-
-#
-# Reconfigure a running VM.
-#
-reconfigure()
-{
-	return 0
-}
-
-
-xm_status()
-{
-	service xend status &> /dev/null
-	if [ $? -ne 0 ]; then 
-		# if xend died
-		echo indeterminate
-		return $OCF_APP_ERR_INDETERMINATE
-	fi
-
-	xm list $OCF_RESKEY_name &> /dev/null
-	if [ $? -eq 0 ]; then
-		echo "running"
-		return 0
-	fi
-	xm list migrating-$OCF_RESKEY_name &> /dev/null
-	if [ $? -eq 0 ]; then
-		echo "running"
-		return 0
-	fi
-	echo "not running"
-	return 1
-}
-
-
-virsh_status()
-{
-	declare state pid
-
-	if [ "$OCF_RESKEY_hypervisor" = "xen" ]; then
-		service xend status &> /dev/null
-		if [ $? -ne 0 ]; then 
-			echo indeterminate
-			return $OCF_APP_ERR_INDETERMINATE
-		fi
-	fi
-
-	#
-	# libvirtd is required when using virsh even though
-	# not specifically when also using Xen.  This is because
-	# libvirtd is required for migration.
-	#
-	pid=$(pidof libvirtd)
-	if [ -z "$pid" ]; then 
-		echo indeterminate
-		return $OCF_APP_ERR_INDETERMINATE
-	fi
-
-	state=$(virsh domstate $OCF_RESKEY_name)
-
-	echo $state
-
-	if [ "$state" = "running" ] || [ "$state" = "paused" ] || [ "$state" = "no state" ] || 
-	   [ "$state" = "idle" ]; then
-		return 0
-	fi
-
-	if [ "$state" = "shut off" ]; then
-		return $OCF_NOT_RUNNING
-	fi
-
-	return $OCF_ERR_GENERIC
-}
-
-
-#
-# Simple status check: Find the VM in the list of running
-# VMs
-#
-do_status()
-{
-	if [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-		virsh_status
-		return $?
-	fi
-
-	xm_status
-	return $?
-}
-
-
-#
-# virsh "path" attribute support
-#
-check_config_file()
-{
-	declare path=$1
-
-	if [ -f "$path/$OCF_RESKEY_name" ]; then
-		echo $path/$OCF_RESKEY_name
-		return 2
-	elif [ -f "$path/$OCF_RESKEY_name.xml" ]; then
-		echo $path/$OCF_RESKEY_name.xml
-		return 2
-	fi
-
-	return 0
-}
-
-
-parse_input()
-{
-	declare delim=$1
-	declare input=$2
-	declare func=$3
-	declare inp
-	declare value
-
-	while [ -n "$input" ]; do
-		value=${input/$delim*/}
-		if [ -n "$value" ]; then
-			eval $func $value
-			if [ $? -eq 2 ]; then
-				return 0
-			fi
-		fi
-		inp=${input/$value$delim/}
-		if [ "$input" = "$inp" ]; then
-			inp=${input/$value/}
-		fi
-		input=$inp
-	done
-}
-
-
-search_config_path()
-{
-	declare config_file=$(parse_input ":" "$OCF_RESKEY_path" check_config_file)
-
-	if [ -n "$config_file" ]; then
-		export OCF_RESKEY_xmlfile=$config_file
-		return 0
-	fi
-
-	return 1
-}
-
-
-choose_management_tool()
-{
-	declare -i is_xml
-
-	#
-	# Don't override user value for use_virsh if one is given
-	#
-	if [ -n "$OCF_RESKEY_use_virsh" ]; then
-		return 0
-	fi
-
-	which xmllint &> /dev/null
-	if [ $? -ne 0 ]; then
-		ocf_log warning "Could not find xmllint; assuming virsh mode"
-		export OCF_RESKEY_use_virsh=1
-		unset OCF_RESKEY_path
-		return 0
-	fi
-
-	xmllint $OCF_RESKEY_xmlfile &> /dev/null
-	is_xml=$?
-
-	if [ $is_xml -eq 0 ]; then
-		ocf_log debug "$OCF_RESKEY_xmlfile is XML; using virsh"
-		export OCF_RESKEY_use_virsh=1
-		unset OCF_RESKEY_path
-	else
-		ocf_log debug "$OCF_RESKEY_xmlfile is not XML; using xm"
-		export OCF_RESKEY_use_virsh=0
-		unset OCF_RESKEY_xmlfile
-	fi
-
-	return 0
-}
-
-
-
-validate_all()
-{
-	if [ "$(id -u)" != "0" ]; then
-	       ocf_log err "Cannot control VMs. as non-root user."
-	       return 1
-	fi
-
-	#
-	# If someone selects a hypervisor, honor it.
-	# Otherwise, ask virsh what the hypervisor is.
-	#
-	if [ -z "$OCF_RESKEY_hypervisor" ] ||
-	   [ "$OCF_RESKEY_hypervisor" = "auto" ]; then
-		export OCF_RESKEY_hypervisor="`virsh version | grep \"Running hypervisor:\" | awk '{print $3}' | tr A-Z a-z`"
-		if [ -z "$OCF_RESKEY_hypervisor" ]; then
-			ocf_log err "Could not determine Hypervisor"
-			return $OCF_ERR_ARGS
-		fi
-		echo Hypervisor: $OCF_RESKEY_hypervisor 
-	fi
-
-	#
-	# Xen hypervisor only for when use_virsh = 0.
-	#
-	if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
-		if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
-			ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
-			return $OCF_ERR_ARGS
-		fi
-
-		if [ -n "$OCF_RESKEY_xmlfile" ]; then
-			ocf_log err "Cannot use xmlfile if use_virsh is set to 0"
-			return $OCF_ERR_ARGS
-		fi
-	else
-
-		#
-		# Virsh path support.
-		#
-		if [ -n "$OCF_RESKEY_path" ] &&
-		   [ "$OCF_RESKEY_path" != "/etc/xen" ]; then
-			if [ -n "$OCF_RESKEY_xmlfile" ]; then
-				ocf_log warning "Using $OCF_RESKEY_xmlfile instead of searching $OCF_RESKEY_path"
-			else
-				search_config_path
-				if [ $? -ne 0 ]; then
-					ocf_log warning "Could not find $OCF_RESKEY_name or $OCF_RESKEY_name.xml in search path $OCF_RESKEY_path"
-					unset OCF_RESKEY_xmlfile
-				else
-					ocf_log debug "Using $OCF_RESKEY_xmlfile"
-				fi
-				choose_management_tool
-			fi
-		else
-			export OCF_RESKEY_use_virsh=1
-		fi
-	fi
-
-	if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
-
-		echo "Management tool: xm"
-		which xm &> /dev/null
-		if [ $? -ne 0 ]; then
-			ocf_log err "Cannot find 'xm'; is it installed?"
-			return $OCF_ERR_INSTALLED
-		fi
-
-		if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
-			ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
-			return $OCF_ERR_ARGS
-		fi
-	else
-		echo "Management tool: virsh"
-		which virsh &> /dev/null
-		if [ $? -ne 0 ]; then
-			ocf_log err "Cannot find 'virsh'; is it installed?"
-			return $OCF_ERR_INSTALLED
-		fi
-	fi
-
-	#
-	# Set the hypervisor URI
-	#
-	if [ -z "$OCF_RESKEY_hypervisor_uri" -o "$OCF_RESKEY_hypervisor_uri" = "auto" ] &&
-	   [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-
-		# Virsh makes it easier to do this.  Really.
-		if [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
-			OCF_RESKEY_hypervisor_uri="qemu:///system"
-		fi
-
-		# I just need to believe in it more.
-		if [ "$OCF_RESKEY_hypervisor" = "xen" ]; then
-			OCF_RESKEY_hypervisor_uri="xen:///"
-		fi
-
-		echo Hypervisor URI: $OCF_RESKEY_hypervisor_uri
-	fi
-
-	#
-	# Set the migration URI
-	#
-	if [ -z "$OCF_RESKEY_migration_uri" -o "$OCF_RESKEY_migration_uri" = "auto" ] &&
-	   [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-
-		# Virsh makes it easier to do this.  Really.
-		if [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
-			export OCF_RESKEY_migration_uri="qemu+ssh://%s/system"
-			export migrateuriopt="tcp:%s"
-		fi
-
-		# I just need to believe in it more.
-		if [ "$OCF_RESKEY_hypervisor" = "xen" ]; then
-			export OCF_RESKEY_migration_uri="xenmigr://%s/"
-		fi
-
-		[ -n "$OCF_RESKEY_migration_uri" ] && echo Migration URI format: $(printf $OCF_RESKEY_migration_uri target_host)
-	fi
-
-	if [ -z "$OCF_RESKEY_name" ]; then
-		echo No domain name specified
-		return $OCF_ERR_ARGS
-	fi
-
-	#virsh list --all | awk '{print $2}' | grep -q "^$OCF_RESKEY_name\$"
-	return $?
-}
-
-
-virsh_migrate()
-{
-	declare target=$1
-	declare rv=1
-
-	#
-	# Xen and qemu have different migration mechanisms
-	#
-	if [ "$OCF_RESKEY_hypervisor" = "xen" ]; then 
-		cmd="virsh migrate $migrate_opt $OCF_RESKEY_name $OCF_RESKEY_hypervisor_uri $(printf $OCF_RESKEY_migration_uri $target)"
-		ocf_log debug "$cmd"
-		
-		err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
-		rv=$?
-	elif [ "$OCF_RESKEY_hypervisor" = "qemu" ]; then
-		cmd="virsh migrate $migrate_opt $OCF_RESKEY_name $(printf $OCF_RESKEY_migration_uri $target) $(printf $migrateuriopt $target)"
-		ocf_log debug "$cmd"
-		
-		err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
-		rv=$?
-	fi
-
-	if [ $rv -ne 0 ]; then
-		ocf_log err "Migrate $OCF_RESKEY_name to $target failed:"
-		ocf_log err "$err"
-
-		if [ "$err" != "${err/does not exist/}" ]; then
-			return $OCF_ERR_CONFIGURED
-		fi
-		if [ "$err" != "${err/Domain not found/}" ]; then
-			return $OCF_ERR_CONFIGURED
-		fi
-
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $rv
-}
-
-
-#
-# XM migrate
-#
-xm_migrate()
-{
-	declare target=$1
-	declare errstr rv migrate_opt cmd
-
-	rv=1
-
-	if [ "$OCF_RESKEY_migrate" = "live" ]; then
-		migrate_opt="-l"
-	fi
-
-	# migrate() function  sets target using migration_mapping;
-	# no need to do it here anymore
-	cmd="xm migrate $migrate_opt $OCF_RESKEY_name $target"
-	ocf_log debug "$cmd"
-
-	err=$($cmd 2>&1 | head -1; exit ${PIPESTATUS[0]})
-	rv=$?
-
-	if [ $rv -ne 0 ]; then
-		ocf_log err "Migrate $OCF_RESKEY_name to $target failed:"
-		ocf_log err "$err"
-
-		if [ "$err" != "${err/does not exist/}" ]; then
-			return $OCF_NOT_RUNNING
-		fi
-		if [ "$err" != "${err/Connection refused/}" ]; then
-			return $OCF_ERR_CONFIGURED
-		fi
-
-		return $OCF_ERR_GENERIC
-	fi
-
-	return $?
-}
-
-# 
-# Virsh migrate
-#
-migrate()
-{
-	declare target=$1
-	declare rv migrate_opt
-
-	if [ "$OCF_RESKEY_migrate" = "live" ]; then
-		migrate_opt="--live"
-	fi
-
-	# Patch from Marcelo Azevedo to migrate over private
-	# LANs instead of public LANs
-        if [ -n "$OCF_RESKEY_migration_mapping" ] ; then
-                target=${OCF_RESKEY_migration_mapping#*$target:} target=${target%%,*}
-        fi
-
-	if [ "$OCF_RESKEY_use_virsh" = "1" ]; then
-		virsh_migrate $target
-		rv=$?
-	else
-		xm_migrate $target
-		rv=$?
-	fi
-
-	return $rv
-}
-
-
-wait_start()
-{
-	declare -i timeout_remaining=$(get_timeout)
-	declare -i start_time
-	declare -i end_time
-	declare -i delta
-	declare -i sleep_time
-
-	if [ -z "$OCF_RESKEY_status_program" ]; then
-		return 0
-	fi
-
-	while [ $timeout_remaining -gt 0 ]; do
-		start_time=$(date +%s)
-		bash -c "$OCF_RESKEY_status_program"
-		if [ $? -eq 0 ]; then
-			return 0
-		fi
-		end_time=$(date +%s)
-		delta=$(((end_time - start_time)))
-		sleep_time=$(((5 - delta)))
-
-		((timeout_remaining -= $delta))
-		if [ $sleep_time -gt 0 ]; then
-			sleep $sleep_time
-			((timeout_remaining -= $sleep_time))
-		fi
-	done
-
-	ocf_log err "Start of $OCF_RESOURCE_INSTANCE has failed"
-	ocf_log err "Timeout exceeded while waiting for \"$OCF_RESKEY_status_program\""
-
-	return 1
-}
-
-#
-#
-#
-
-case $1 in
-	start)
-		validate_all || exit $OCF_ERR_ARGS
-		do_start
-		rv=$?
-		if [ $rv -ne 0 ]; then
-			exit $rv
-		fi
-
-		wait_start
-		exit $?
-		;;
-	stop)
-		validate_all || exit $OCF_ERR_ARGS
-		do_stop shutdown destroy
-		exit $?
-		;;
-	kill)
-		validate_all || exit $OCF_ERR_ARGS
-		do_stop destroy
-		exit $?
-		;;
-	recover|restart)
-		exit 0
-		;;
-	status|monitor)
-		validate_all || exit $OCF_ERR_ARGS
-		echo -n "Virtual machine $OCF_RESKEY_name is "
-		do_status
-		rv=$?
-		if [ $rv -ne 0 ]; then
-			exit $rv
-		fi
-		[ -z "$OCF_RESKEY_status_program" ] && exit 0
-		[ -z "$OCF_CHECK_LEVEL" ] && exit 0
-		[ $OCF_CHECK_LEVEL -lt 10 ] && exit 0
-
-		bash -c "$OCF_RESKEY_status_program" &> /dev/null
-		exit $?
-		;;
-	migrate)
-		validate_all || exit $OCF_ERR_ARGS
-		migrate $2 # Send VM to this node
-		rv=$?
-		if [ $rv -eq $OCF_ERR_GENERIC ]; then
-			# Catch-all: If migration failed with
-			# an unhandled error, do a status check
-			# to see if the VM is really dead.
-			#
-			# If the VM is still in good health, return
-			# a value to rgmanager to indicate the 
-			# non-critical error
-			#
-			# OCF states that codes 150-199 are reserved
-			# for application use, so we'll use 150
-			#
-			do_status > /dev/null
-			if [ $? -eq 0 ]; then
-				rv=150
-			fi
-		fi
-		exit $rv
-		;;
-	reload)
-		exit 0
-		;;
-	reconfig)
-		validate_all || exit $OCF_ERR_ARGS
-		echo "$0 RECONFIGURING $OCF_RESKEY_memory"
-		reconfigure
-		exit $?
-		;;
-	meta-data)
-		meta_data
-		exit 0
-		;;
-	validate-all)
-		validate_all
-		exit $?
-		;;
-	*)
-		echo "usage: $0 {start|stop|restart|status|reload|reconfig|meta-data|validate-all}"
-		exit 1
-		;;
-esac


More information about the cluster-commits mailing list