您的位置:首页 > 运维架构 > Linux

CentOS Jboss7的一个初始化脚本(用于启动、停止)

2012-05-11 17:00 387 查看
具体使用同nginx的启动脚本。脚本内容如下:

#!/bin/sh

#chkconfig: 345 99 10

#description: JBoss auto start-stop script.

# Source function library.

. /etc/rc.d/init.d/functions

# Get config.

. /etc/sysconfig/network

# Check that networking is up.

[ "${NETWORKING}" = "no" ] && exit 0

### CHANGE THE STARTUP PATH TO YOUR START SCRIPT ###

startup='/usr/local/jboss-as-7.1.1.Final/bin/standalone.sh > /dev/null 2> /dev/null &'

shutdown='killall java'

start(){

echo -n $"Starting JBoss service: "

$startup

RETVAL=$?

echo

}

stop(){

action $"Stopping JBoss service: " $shutdown

RETVAL=$?

echo

}

restart(){

stop

sleep 10

start

}

# See how we were called.

case "$1" in

start)

start

;;

stop)

stop

;;

restart)

restart

;;

*)

echo $"Usage: $0 {start|stop|restart}"

exit 1

esac
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: