[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Cluster Project branch, STABLE2, updated. cluster-2.02.00-8-g6c44b74



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=6c44b743290d210c13d1ca7fc18414ec4eaffe5c

The branch, STABLE2 has been updated
       via  6c44b743290d210c13d1ca7fc18414ec4eaffe5c (commit)
       via  c0186dcb13e57349fd6409dc7c4ba021854f1bd5 (commit)
       via  4f9f9dc5a95e738c098c5743f5e52f6af704bf88 (commit)
      from  ef1b4ba484adaed815f456dad63de841fe46ddaf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6c44b743290d210c13d1ca7fc18414ec4eaffe5c
Author: Lon Hohberger <lhh redhat com>
Date:   Tue Mar 4 11:54:40 2008 -0500

    Add / fix Oracle 10g failover agent

commit c0186dcb13e57349fd6409dc7c4ba021854f1bd5
Author: Lon Hohberger <lhh redhat com>
Date:   Tue Mar 4 11:38:39 2008 -0500

    Update changelog

commit 4f9f9dc5a95e738c098c5743f5e52f6af704bf88
Author: Lon Hohberger <lhh redhat com>
Date:   Tue Mar 4 11:29:03 2008 -0500

    Add Sybase failover agent

-----------------------------------------------------------------------

Summary of changes:
 rgmanager/ChangeLog                               |    4 +
 rgmanager/src/resources/ASEHAagent.sh             |  893 +++++++++++++++++++++
 rgmanager/src/resources/Makefile                  |    3 +-
 rgmanager/src/resources/{oracleas => oracledb.sh} |  207 ++++--
 4 files changed, 1041 insertions(+), 66 deletions(-)
 create mode 100644 rgmanager/src/resources/ASEHAagent.sh
 rename rgmanager/src/resources/{oracleas => oracledb.sh} (77%)

diff --git a/rgmanager/ChangeLog b/rgmanager/ChangeLog
index 249e6ca..117e5a3 100644
--- a/rgmanager/ChangeLog
+++ b/rgmanager/ChangeLog
@@ -1,3 +1,7 @@
+2008-03-04 Lon Hohberger <lhh at redhat.com>
+	* src/resources/ASEHAagent.sh, Makefile: Add Sybase failover agent
+	* src/resources/oracledb.sh, Makefile: Add Oracle 10g failover agent
+
 2008-02-26 Lon Hohberger <lhh at redhat.com>
 	* src/resources/ip.sh: Fix netmask handling in ip.sh
 	* src/utils/clustat.c: Don't show estranged nodes if they're down
diff --git a/rgmanager/src/resources/ASEHAagent.sh b/rgmanager/src/resources/ASEHAagent.sh
new file mode 100644
index 0000000..6d781d7
--- /dev/null
+++ b/rgmanager/src/resources/ASEHAagent.sh
@@ -0,0 +1,893 @@
+#!/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 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="/tmp/ASEHAagent.1"
+	tmpfile2="/tmp/ASEHAagent.2"
+	
+	# 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
+
+	# 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}'`
+
+		# Kill the isql process directly.
+		kill -9 $pid
+		return 1
+	fi
+
+	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
index f07122d..2c17e16 100644
--- a/rgmanager/src/resources/Makefile
+++ b/rgmanager/src/resources/Makefile
@@ -21,7 +21,8 @@ RESOURCES=fs.sh 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 lvm.sh lvm_by_lv.sh lvm_by_vg.sh \
-	vm.sh SAPInstance SAPDatabase named.sh
+	vm.sh SAPInstance SAPDatabase named.sh \
+	oracledb.sh ASEHAagent.sh
 
 METADATA=apache.metadata openldap.metadata samba.metadata \
 	mysql.metadata postgres-8.metadata tomcat-5.metadata \
diff --git a/rgmanager/src/resources/oracleas b/rgmanager/src/resources/oracledb.sh
similarity index 77%
rename from rgmanager/src/resources/oracleas
rename to rgmanager/src/resources/oracledb.sh
index e806049..5b8e113 100755
--- a/rgmanager/src/resources/oracleas
+++ b/rgmanager/src/resources/oracledb.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright 2003-2004 Red Hat, Inc.
+# Copyright 2003-2004, 2006-2007 Red Hat, Inc.
 #
 # Author(s):
 #     Hardy Merrill <hmerrill at redhat.com>
@@ -15,10 +15,8 @@
 #
 # chkconfig: 345 99 01
 # description: Service script for starting/stopping      \
-#              Oracle(R) Application Server software on: \
-#			Red Hat Enterprise Linux 2.1 AS  \
-#			Red Hat Enterprise Linux 3 AS    \
-#			Red Hat Enterprise Linux 3 ES
+#	       Oracle(R) Database 10g on                 \
+#		        Red Hat Enterprise Linux 5
 #
 # NOTES:
 #
@@ -26,27 +24,36 @@
 # the need for this script to access anything outside of the ORACLE_HOME 
 # path.
 #
-# (2) You MUST customize ORACLE_USER, ORACLE_HOME, and ORACLE_SID to match
-# your installation!
+# (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.
+# 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
 
-declare SCRIPT="`basename $0`"
+#
+# 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_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. #
@@ -57,7 +64,7 @@ declare SCRIPT="`basename $0`"
 #    to the Oracle user and restart.  Oracle needs to run as the Oracle
 #    user, not as root.
 #
-[ -n "$ORACLE_USER" ] || ORACLE_USER=oracle
+#[ -n "$ORACLE_USER" ] || ORACLE_USER=oracle
 
 #
 # 2. Oracle home.  This is set up during the installation phase of Oracle.
@@ -65,27 +72,43 @@ declare SCRIPT="`basename $0`"
 #    you intend to use as the mount point for your Oracle Infrastructure
 #    service.
 #
-[ -n "$ORACLE_HOME" ] || ORACLE_HOME=/mnt/oracle/oracle-10g
+#[ -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=asdb
+#[ -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="/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=10g
+
+#
+# 6. Oracle virtual hostname.  This is the hostname you gave Oracle during
+#    installation.
+#
+#[ -n "$ORACLE_HOSTNAME" ] || ORACLE_HOSTNAME=svc0.foo.test.com
+
+
+
 ###########################################################################
-export ORACLE_USER ORACLE_HOME ORACLE_SID LOCKFILE
+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.
+# 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
@@ -98,13 +121,6 @@ declare -r	DB_PROCNAMES="pmon"
 declare -r	LSNR_PROCNAME="tnslsnr"
 #declare -r	LSNR_PROCNAME="tnslsnrXX" # testing
 
-#
-# The oracle user probably doesn't have the permission to write to 
-# /var/lock/subsys, so use the user's home directory.
-#
-declare -r	LOCKFILE="/home/$ORACLE_USER/.oracle-ias.lock"
-#declare -r	LOCKFILE="$ORACLE_HOME/.oracle-ias.lock"
-#declare -r	LOCKFILE="/var/lock/subsys/oracle-ias" # Watch privileges
 
 ##########################################################
 # (Hopefully) No user-serviceable parts below this line. #
@@ -113,14 +129,14 @@ meta_data()
 {
 	cat <<EOT
 <?xml version="1.0" ?>
-<resource-agent name="oracleas" version="rgmanager 2.0">
+<resource-agent name="oracledb" version="rgmanager 2.0">
     <version>1.0</version>
 
     <longdesc lang="en">
-	Oracle Application 10g Failover Instance
+	Oracle 10g Failover Instance
     </longdesc>
     <shortdesc lang="en">
-	Oracle Application 10g Failover Instance
+	Oracle 10g Failover Instance
     </shortdesc>
 
     <parameters>
@@ -145,7 +161,7 @@ meta_data()
 	    <content type="string"/>
         </parameter>
 
-        <parameter name="device" unique="1" required="1">
+        <parameter name="home" unique="1" required="1">
 	    <longdesc lang="en">
 		This is the Oracle (application, not user) home directory.
 		This is configured when you install Oracle.
@@ -156,6 +172,32 @@ meta_data()
 	    <content type="string"/>
         </parameter>
 
+        <parameter name="type" required="1">
+	    <longdesc lang="en">
+		This is the Oracle installation type.
+		Only "10g" and "10g-ias" are supported, and 10g-ias is
+		untested.
+	    </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>
@@ -176,7 +218,7 @@ meta_data()
 	<action name="monitor" depth="20" timeout="90" interval="10m"/>
 
 	<action name="meta-data" timeout="5"/>
-	<action name="validate-all" timeout="5"/>
+	<action name="verify-all" timeout="5"/>
     </actions>
 
     <special tag="rgmanager">
@@ -615,15 +657,15 @@ 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
+	[ -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
+	#[ -d "$ORACLE_HOME" ] || oops ORACLE_HOME
 
 	#
 	# If the oracle SID is NULL, we're done
@@ -631,13 +673,27 @@ validation_checks()
 	[ -n "$ORACLE_SID" ] || oops ORACLE_SID
 
 	#
+	# If we don't know the type, we're done
+	#
+	[ "$ORACLE_TYPE" = "10g" ] || [ "$ORACLE_TYPE" = "10g-ias" ] || oops ORACLE_TYPE
+
+	#
+	# 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 as $ORACLE_USER."
-		#exec su - $ORACLE_USER -c "$0 $*"
-		exec sudo -u $ORACLE_USER $0 $*
+		echo "Restarting $0 as $ORACLE_USER."
+		#
+		# Breaks on RHEL5 
+		# exec sudo -u $ORACLE_USER $0 $*
+		#
+		su $ORACLE_USER -c "$0 $*"
+		exit $?
 	fi
 
 	#
@@ -658,12 +714,18 @@ validation_checks()
 #
 # Start Oracle9i Application Server Infrastructure
 #
-start_ias()
+start_oracle()
 {
 	faction "Starting Oracle Database:" start_db || return 1
 	action "Starting Oracle Listener:" lsnrctl start || return 1
-	action "Starting Oracle EM:" emctl start em || return 1
-	action "Starting iAS Infrastructure:" opmnctl startall || return 1
+
+	if [ "$ORACLE_TYPE" = "10g" ]; then
+		action "Starting iSQL*Plus:" isqlplusctl start || return 1
+		action "Starting Oracle EM DB Console:" emctl start dbconsole || return 1
+	elif [ "$ORACLE_TYPE" = "10g-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
@@ -675,10 +737,22 @@ start_ias()
 #
 # Stop Oracle9i Application Server Infrastructure
 #
-stop_ias()
+stop_oracle()
 {
-	action "Stopping iAS Infrastructure:" opmnctl stopall || return 1
-	action "Stopping Oracle EM:" emctl stop em || return 1
+	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" = "10g" ]; then
+		action "Stopping Oracle EM DB Console:" emctl stop dbconsole || return 1
+		action "Stopping iSQL*Plus:" isqlplusctl stop || return 1
+	elif [ "$ORACLE_TYPE" = "10g-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
 	faction "Waiting for all Oracle processes to exit:" exit_idle 
@@ -712,7 +786,7 @@ stop_ias()
 # - If all are running, return 0.  In the "all-running" case, we recreate
 # $LOCKFILE if it does not exist.
 #
-status_ias()
+status_oracle()
 {
 	declare -i subsys_lock=1
 	declare -i last 
@@ -735,10 +809,17 @@ status_ias()
 	update_status $? $last
 	last=$?
 	
-	# Check & report opmn / opmn-managed process status
-	get_opmn_status $subsys_lock $depth
-	update_status $? $last
-	last=$?
+	if [ "$ORACLE_TYPE" = "10g" ]; then
+		# XXX Add isqlplus status check?!
+		emctl status dbconsole 2>&1 | grep "is running"
+		update_status $? $last
+		last=$?
+	elif [ "$ORACLE_TYPE" = "10g-ias" ]; then
+		# Check & report opmn / opmn-managed process status
+		get_opmn_status $subsys_lock $depth
+		update_status $? $last
+		last=$?
+	fi
 
 	#
 	# No lock file, but everything's running.  Put the lock
@@ -755,38 +836,34 @@ status_ias()
 ########################
 # Do some real work... #
 ########################
+if [ "$1" = "meta-data" ]; then
+	meta_data
+	exit 0
+fi
+
+validation_checks $*
+
 case $1 in
-	meta-data)
-		meta_data
-		exit $?
-		;;
-	validate-all)
-		validation_checks $*
-		exit 0 # XXX XXX XXX
-		;;
 	start)
-		validation_checks $*
-		start_ias
+		start_oracle
 		exit $?
 		;;
 	stop)
-		validation_checks $*
-		stop_ias
+		stop_oracle
 		exit $?
 		;;
 	status|monitor)
-		validation_checks $*
-		status_ias $OCF_CHECK_LEVEL
+		status_oracle $OCF_CHECK_LEVEL
 		exit $?
 		;;
 	restart)
 		$0 stop || exit $?
 		$0 start || exit $?
-		exit $OCF_SUCCESS
+		exit 0
 		;;
 	*)
-		echo "usage: $SCRIPT {start|stop|status|restart|validate-all|monitor}"
-		exit $OCF_ERR_UNIMPLEMENTED
+		echo "usage: $SCRIPT {start|stop|status|restart|meta-data}"
+		exit 1
 		;;
-esac	
+esac
 exit 0


hooks/post-receive
--
Cluster Project


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]