Created
August 7, 2012 13:39
-
-
Save chebyte/3285426 to your computer and use it in GitHub Desktop.
tomcat6 init service ubuntu
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/sh | |
# Tomcat Startup Script | |
CATALINA_HOME=/opt/tomcat6; export CATALINA_HOME | |
JAVA_HOME=/usr; export JAVA_HOME | |
TOMCAT_OWNER=rails; export TOMCAT_OWNER | |
start() { | |
echo -n "Starting Tomcat: " | |
su $TOMCAT_OWNER -c $CATALINA_HOME/bin/startup.sh | |
sleep 2 | |
} | |
stop() { | |
echo -n "Stopping Tomcat: " | |
su $TOMCAT_OWNER -c $CATALINA_HOME/bin/shutdown.sh | |
} | |
# See how we were called. | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo $"Usage: tomcat {start|stop|restart}" | |
exit | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment