jboss_start.sh
#!/bin/sh
# This file: jboss_start.sh
# Version: 6.0.1
HAHOME=`cat /etc/init.d/HAHOME`
export HAHOME
out=$HAHOME/bin/APIOUT.x
JOBNAME=$2
# When Another Server are Down, You MUST sleep awhile.
# You can change this value to meet your requirement if need.
#if [ "$1" = "anotherdown" ]
#then
# /bin/sleep 30
#fi
# DISKDEV=/dev/sda5
# MOUNTPOINT=/appdata/tomcat
# $HAHOME/bin/dflush $DISKDEV
# fsck -a $DISKDEV
# if test $? -ne 0
# then
# ${out} "[INFO] fsck ${DISKDEV}......"
# fsck -yf $DISKDEV
# fi
# mount $DISKDEV $MOUNTPOINT
# mount | grep "${DISKDEV} on ${MOUNTPOINT} " >/dev/null 2>&1
# if test $? -ne 0
# then
# ${out} "[INFO] Cannot mount ${DISKDEV}."
# exit
# fi
${out} "[INFO] Start jboss server...."
nohup /usr/local/install/jboss-4.2.3.GA/bin/run.sh -b 192.168.0.5 >/dev/null 2>
&1 &
sleep 70
${out} "[INFO] Start shell <$0> finished."
----------------------------------------------------------------
jboss_stop.sh
#!/bin/sh
# This file: jboss_stop.sh
# Version: 6.0.1
HAHOME=`cat /etc/init.d/HAHOME`
export HAHOME
out=$HAHOME/bin/APIOUT.x
JOBNAME=$2
# DISKDEV=/dev/sda5
# MOUNTPOINT=/appdata/tomcat
ERRORNUMBER=$3
${out} "[INFO] The service <${JOBNAME}> stop because of {$ERRORNUMBER}."
${out} "[INFO] Stop jboss server...."
#su - bossjn -c /deploy/jboss/bin/stop >/dev/null 2>&1
#/usr/local/install/jboss-4.2.3.GA/bin/shutdown.sh -S >/dev/null 2>&1
pid=`pgrep -x java`
kill -9 $pid
sync
# $HAHOME/bin/UMOUNT $DISKDEV $MOUNTPOINT
# mount | grep "${DISKDEV} on ${MOUNTPOINT} " >/dev/null 2>&1
# if test $? -eq 0
# then
# ${out} "[WARNING] Cannot umount ${DISKDEV}."
# /sbin/reboot
# fi
${out} "[INFO] Stop shell <$0> finished.