resin 3 启动脚本

#!/bin/sh
#
# Linux startup script for Resin
# chkconfig: 345 85 15
# description: Resin is a Java Web server.
# processname: wrapper.pl
#
# To install, configure this file as needed and copy init.resin
# to /etc/rc.d/init.d as resin. Then use "# /sbin/chkconfig resin reset"
#
JAVA_HOME=/usr/lib/jvm/java-6-sun
RESIN_HOME=/web/container/resin-pro-3.1.12

export JAVA_HOME RESIN_HOME

JAVA=$JAVA_HOME/bin/java
#
# If you want to start the entire Resin process as a different user,
# set this to the user name. If you need to bind to a protected port,
# e.g. port 80, you can't use USER, but will need to use bin/resin.
#
USER=resin
#
# Set to the server id to start
#
#SERVER="-server app-a"
#
SERVER_NAME=$2
if [ -z "$SERVER_NAME" ];then
SERVER_NAME="resin"
fi
SERVER="-server $SERVER_NAME"
ARGS="-resin-home $RESIN_HOME $SERVER -conf $RESIN_HOME/conf/$SERVER_NAME.conf "
#-log-directory $RESIN_HOME/log/$SERVER_NAME.log"
echo $ARGS
if test -r /lib/lsb/init-functions; then
. /lib/lsb/init-functions
else

log_daemon_msg () {
if [ -z "$1" ]; then
return 1
fi

if [ -z "$2" ]; then
echo -n "$1:"
return
fi

echo -n "$1: $2"
}

log_end_msg () {
[ -z "$1" ] && return 1

if [ $1 -eq 0 ]; then
echo " ."
else
echo " failed!"
fi

return $1
}

fi

case "$1" in
start)
log_daemon_msg "Starting resin"
if test -n "$USER"; then
su $USER -c "$JAVA -jar $RESIN_HOME/lib/resin.jar $ARGS start" #1>/dev/null 2>/dev/null
else
$JAVA -jar $RESIN_HOME/lib/resin.jar $ARGS start 1>/dev/null 2>/dev/null
fi
echo $?
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping resin"
if test -n "$USER"; then
su $USER -c "$JAVA -jar $RESIN_HOME/lib/resin.jar $ARGS stop" 1>/dev/null 2>/dev/null
else
$JAVA -jar $RESIN_HOME/lib/resin.jar $ARGS stop 1>/dev/null 2>/dev/null
fi
log_end_msg $?
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

exit 0

转载于:https://www.cnblogs.com/edwardlauxh/archive/2012/11/26/2789196.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值