Created
September 26, 2016 15:55
-
-
Save duguying/87a16099a496e3ee88e5e5e1cd1c4be1 to your computer and use it in GitHub Desktop.
tomcat自启动脚本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/java/jdk1.8.0_102 | |
export JAVA_HOME | |
CATALANA_HOME=/usr/local/tomcat | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment