centos 7 tomcat 開機啓動

[root@localhost ~]# vi /etc/init.d/tomcat_uc web

#!/bin/bash
#centos

tomcat startup script for the Tomcat server

#
#tomcat

chkconfig: 345 80 20

description: start the tomcat deamon

#bash

Source function library

. /etc/rc.d/init.d/functionside

prog=tomcat_uc
JAVA_HOME=/usr/local/jdk
export JAVA_HOME
CATALANA_HOME=/usr/local/webserver/tomcat_uc
export CATALINA_HOMErest

case "$1" in
start)
echo "Starting Tomcat..."
$CATALANA_HOME/bin/startup.sh
;;server

stop)
echo "Stopping Tomcat..."
$CATALANA_HOME/bin/shutdown.sh
;;ip

restart)
echo "Stopping Tomcat..."
$CATALANA_HOME/bin/shutdown.sh
sleep 2
echo
echo "Starting Tomcat..."
$CATALANA_HOME/bin/startup.sh
;;it

*)
echo "Usage: $prog {start|stop|restart}"
;;
esac
exit 0io

chmod +x /etc/init.d/tomcat_uc注意centos 7 [root@localhost init.d]# pwd/etc/init.d[root@localhost init.d]# systemctl stop tomcat_uc.service[root@localhost init.d]# systemctl start tomcat_uc.service[root@localhost init.d]#

相關文章
相關標籤/搜索