#!/bin/sh## Description: Manages a Jboss Server as an OCF High-Availability# resource under Heartbeat/LinuxHA control

## 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# of the License, 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; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA.## Copyright (c) 2009 Bauer Systems KG / Stefan Schluppeck#

######################################################################## OCF parameters:# OCF_RESKEY_jboss_name - The name of the resource. Default is jboss# OCF_RESKEY_script_log - A destination of the log of this script. Default /var/log/${OCF_RESKEY_jboss_name}.log# OCF_RESKEY_jboss_stop_timeout - Time-out at the time of the stop. Default is 5# OCF_RESKEY_jboss_suspend_trialcount - The re-try number of times awaiting a stop. Default is 10# OCF_RESKEY_jboss_user - A user name to start a resource. Default is root# OCF_RESKEY_statusurl - URL for state confirmation. Default is http://127.0.0.1:8080

# OCF_RESKEY_java_home - Home directory of the Java. Default is None# OCF_RESKEY_jboss_home - Home directory of Jboss. Default is None# OCF_RESKEY_jboss_pstring - String Jboss will found in procceslist. Default is "java -Dprogram.name=run.sh"# OCF_RESKEY_jboss_sh - Options for jboss to run. Default is "-c default -l lpg4j"###############################################################################

. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs

usage()

{ cat <<-!usage: $0 action

action: start start jboss

stop stop the jboss

status return the status of jboss, run or down

monitor return TRUE if the jboss appears to be working. You have to have installed $WGETNAME for this to work.

<longdesc lang="en">Resource script for Jboss. It manages a Jboss instance as an HA resource.</longdesc>

<shortdesc lang="en">jboss resource agent</shortdesc>

<parameters>

<parameter name="jboss_name" unique="1" required="0">

<longdesc lang="en">The name of the resource</longdesc><shortdesc>The name of the resource</shortdesc><content type="string" default="${OCF_RESKEY_jboss_name}" />

</parameter>

<parameter name="script_log" unique="1" required="0"><longdesc lang="en">A destination of the log of this script

</longdesc><shortdesc>A destination of the log of this script</shortdesc><content type="string" default="${OCF_RESKEY_script_log}" /></parameter>

<parameter name="jboss_stop_timeout" unique="0" required="0"><longdesc lang="en">Time-out at the time of the stop</longdesc>

<shortdesc>Time-out at the time of the stop</shortdesc><content type="integer" default="${OCF_RESKEY_jboss_stop_timeout}" /></parameter>

<parameter name="jboss_suspend_trialcount" unique="0" required="0"><longdesc lang="en">The re-try number of times awaiting a stop</longdesc><shortdesc>The re-try number of times awaiting a stop</shortdesc>