红联Linux门户
Linux帮助

Ubuntu tomcat8启动脚本(最简化)

发布时间:2017-01-07 10:44:35来源:linux网站作者:tengxing007
运行:
$:sudo vi /etc/init.d/tomcat8 
 
添加如下:
#!/bin/sh
# description: Auto-starts tomcat
# processname: tomcat
case $1 in
start)
sh $HOME/JAVA-Development/SERVER/apache-tomcat-8.0.36/bin/startup.sh
;;
stop)
sh $HOME/JAVA-Development/SERVER/apache-tomcat-8.0.36/bin/shutdown.sh
;;
restart)
sh $HOME/JAVA-Development/SERVER/apache-tomcat-8.0.36/bin/startup.sh
sh $HOME/JAVA-Development/SERVER/apache-tomcat-8.0.36/bin/shutdown.sh
;;
esac
exit 0
 
给执行权限chmod 755
OK
$:/etc/init.d/tomcat8 restart
说明:替换tomcat路径即可。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/27599.html