tomcat 啓動腳本2

1java

vi /etc/init.d/tomcat7tomcat

--------------------------------------------------------oracle

#!/bin/sh
#tomcat auto-start
export JAVA_HOME=/usr/lib/jvm/java-7-oracleapp

case "$1" in
start)
 sh /huanxing/servers/tomcat7-apps-8080/bin/startup.sh
 ;;
stop)
 sh /huanxing/servers/tomcat7-apps-8080/bin/shutdown.sh
 ;;
restart)
 sh /huanxing/servers/tomcat7-apps-8080/bin/shutdown.sh
 sh /huanxing/servers/tomcat7-apps-8080/bin/startup.sh
 ;;
*)
 echo 'Usage:tomcat7 start|stop|restart'
 ;;
esac
exit 0jvm

----------------------------------------------------------------------rest

2添加刪除服務server

添加: sudo update-rc.d tomcat7 defaultsrem

刪除:sudo update-rc.d -f tomcat7 removeit


四、啓動、關閉、重啓服務date

/etc/init.d/服務名 start

/etc/init.d/服務名 stop

/etc/init.d/服務名 start

相關文章
相關標籤/搜索