Last active
August 29, 2015 14:14
-
-
Save jaehoo/03714a2984292d45a0dd to your computer and use it in GitHub Desktop.
Unix, Startup script for tomcat 7
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 | |
### BEGIN INIT INFO | |
# Provides: tomcat7 | |
# Required-Start: $network | |
# Required-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start/Stop Tomcat server | |
### END INIT INFO | |
TOMCAT_HOME=/opt/apache-tomcat-7.0.57 | |
PATH=/sbin:/bin:/usr/sbin:/usr/bin | |
start() { | |
sudo -u tomcat $TOMCAT_HOME/bin/startup.sh | |
} | |
stop() { | |
sudo -u tomcat $TOMCAT_HOME/bin/shutdown.sh | |
} | |
case $1 in | |
start|stop) $1;; | |
restart) stop; start;; | |
*) echo "Run as $0 <start|stop|restart>"; exit 1;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment