Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # tomcat Starts Tomcat Java server.
- #
- #
- # chkconfig: 345 88 12
- # description: Tomcat is the server for
- # Java servlet applications.
- ### BEGIN INIT INFO
- # Provides: $tomcat
- ### END INIT INFO
- JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64
- export JAVA_HOME
- PATH=$JAVA_HOME/bin:$PATH
- export PATH
- export CATALINA_HOME=/home/etherpad/etherpad-lti-service/apache-tomcat-5.5.36
- TOMCAT_HOME=$CATALINA_HOME/bin
- START_TOMCAT=$CATALINA_HOME/bin/startup.sh
- STOP_TOMCAT=$CATALINA_HOME/bin/shutdown.sh
- TOMCAT_USER=etherpad
- # Source function library.
- . /etc/init.d/functions
- [ -f $START_TOMCAT ] || exit 0
- [ -f $STOP_TOMCAT ] || exit 0
- RETVAL=0
- umask 077
- start() {
- echo -n $"Starting Tomcat Java server: "
- daemon su -c $START_TOMCAT $TOMCAT_USER
- echo
- return $RETVAL
- }
- stop() {
- echo -n $"Shutting down Tomcat Java server: "
- daemon su -c $STOP_TOMCAT $TOMCAT_USER
- echo
- return $RETVAL
- }
- restart() {
- stop
- start
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart|reload)
- restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart}"
- exit 1
- esac
- exit $?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement