tomcat开机启动脚本
1、tomcat启动脚本有两个不同的版本:
#!/bin/sh
#chmod +x
#chkconfig --add
# tomcat-amazon
#
# chkconfig: - 98 02
#
export JAVA_HOME=/usr/local/java/jdk1.6.0_45
suffix=amazon
prog=tomcat-$suffix
TOMCAT_HOME=/usr/local/tomcat-7.0.54Ajob
export $JAVA_HOME
start_tomcat=$TOMCAT_HOME/bin/startup.sh
stop_tomcat=$TOMCAT_HOME/bin/shutdown.sh
lockfile=/var/lock/subsys/$prog
start() {
echo -n "Starting tomcat-amazon: "
${start_tomcat}
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n "Shutdown tomcat-amazon"
${stop_tomcat}
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
sleep 1
start
}
reload() {
restart
}
#how we were called
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 2
esac
exit 0
新闻名称:tomcat开机启动脚本
本文URL:
http://kswjz.com/article/peoids.html
扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流