tomcat启停脚本
程序员文章站
2022-08-08 16:41:01
脚本存放目录 /etc/init.d/ /etc/init.d/tomcat restart 重启/etc/init.d/tomcat start 启动/etc/init.d/tomcat stop 停止 ......
脚本存放目录 /etc/init.d/
#!/bin/bash
# description: tomcat7 start stop restart
# processname: tomcat7
# chkconfig: 234 20 80
catalina_home=/sdata/software/apache-tomcat-8.5.23
case $1 in
start)
sh $catalina_home/bin/startup.sh
;;
stop)
ps -e|grep java|awk '{print "kill -9 "$1}'|sh
# sh $catalina_home/bin/shutdown.sh
;;
restart)
ps -e|grep java|awk '{print "kill -9 "$1}'|sh
sleep 3
# sh $catalina_home/bin/shutdown.sh
sh $catalina_home/bin/startup.sh
;;
*)
echo 'please use : tomcat {start | stop | restart}'
;;
esac
exit 0
/etc/init.d/tomcat restart 重启
/etc/init.d/tomcat start 启动
/etc/init.d/tomcat stop 停止
上一篇: 超简单详细的搭建个人网站————静态网站
下一篇: 海带可以每天吃吗,答案会让你意想不到