centos6配置tomcat8开机自启动脚本
程序员文章站
2022-04-06 20:33:33
1、vim /etc/init.d/tomcat
#!/bin/bash
#
# tomcat startup script for the tomcat...
1、vim /etc/init.d/tomcat
#!/bin/bash # # tomcat startup script for the tomcat server # # chkconfig: 345 80 20 # description: start the tomcat deamon # # source function library . /etc/rc.d/init.d/functions prog=tomcat java_home=/usr/local/jdk1.8.0_161 export java_home catalana_home=/opt/apache-tomcat-8.5.24/ export catalina_home case "$1" in start) echo "starting tomcat..." $catalana_home/bin/startup.sh ;; stop) echo "stopping tomcat..." $catalana_home/bin/shutdown.sh ;; restart) echo "stopping tomcat..." $catalana_home/bin/shutdown.sh sleep 2 echo echo "starting tomcat..." $catalana_home/bin/startup.sh ;; *) echo "usage: $prog {start|stop|restart}" ;; esac exit 0
2、配置
chmod +x /etc/init.d/tomcat chkconfig tomcat on service tomcat start
总结
以上所述是小编给大家介绍的centos6配置tomcat8开机自启动脚本,希望对大家有所帮助
上一篇: 李遵顼是怎么误国的?他做了什么
下一篇: 桓灵是什么人?竟让刘备叹息痛恨!