Skip to content

Instantly share code, notes, and snippets.

@chebyte
Created August 7, 2012 13:39
Show Gist options
  • Save chebyte/3285426 to your computer and use it in GitHub Desktop.
Save chebyte/3285426 to your computer and use it in GitHub Desktop.
tomcat6 init service ubuntu
#!/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