vim /etc/init.d/tomcat
添加:

!/bin/bash
# description: Tomcat8 Start Stop Restart
# processname: tomcat8
# chkconfig: 234 20 80
CATALINA_HOME=/opt/tomcat8 #tomcat所在路径
case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
*)
echo ‘please use : tomcat {start | stop | restart}’
;;
esac
exit 0


加权限
chmod a+x /etc/init.d/tomcat

service tomcat start
service tomcat stop
service tomcat restart

添加tomcat 服务管理
chkconfig —add tomcat

设置自启动
chkconfig tomcat on

查看状态
chkconfig —list|grep tomcat

关闭自启动
chkconfig tomcat off

删除管理
chkconfig -del tomcat