Advertisement
Guest User

Untitled

a guest
Jul 15th, 2013
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.27 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # tomcat       Starts Tomcat Java server.
  4. #
  5. #
  6. # chkconfig: 345 88 12
  7. # description: Tomcat is the server for
  8. # Java servlet applications.
  9. ### BEGIN INIT INFO
  10. # Provides: $tomcat
  11. ### END INIT INFO
  12.  
  13.  
  14. JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64
  15. export JAVA_HOME  
  16. PATH=$JAVA_HOME/bin:$PATH  
  17. export PATH  
  18.  
  19.  
  20.  
  21. export CATALINA_HOME=/home/etherpad/etherpad-lti-service/apache-tomcat-5.5.36
  22. TOMCAT_HOME=$CATALINA_HOME/bin
  23. START_TOMCAT=$CATALINA_HOME/bin/startup.sh
  24. STOP_TOMCAT=$CATALINA_HOME/bin/shutdown.sh
  25. TOMCAT_USER=etherpad
  26.  
  27.  
  28. # Source function library.
  29. . /etc/init.d/functions
  30.  
  31. [ -f $START_TOMCAT ] || exit 0
  32. [ -f $STOP_TOMCAT ] || exit 0
  33.  
  34. RETVAL=0
  35.  
  36. umask 077
  37.  
  38. start() {
  39.         echo -n $"Starting Tomcat Java server: "
  40.         daemon su -c $START_TOMCAT $TOMCAT_USER
  41.         echo
  42.         return $RETVAL
  43. }
  44. stop() {
  45.         echo -n $"Shutting down Tomcat Java server: "
  46.         daemon su -c $STOP_TOMCAT $TOMCAT_USER
  47.         echo
  48.         return $RETVAL
  49. }
  50. restart() {
  51.         stop
  52.         start
  53. }
  54. case "$1" in
  55.   start)
  56.         start
  57.         ;;
  58.   stop)
  59.         stop
  60.         ;;
  61.   restart|reload)
  62.         restart
  63.         ;;
  64.   *)
  65.         echo $"Usage: $0 {start|stop|restart}"
  66.         exit 1
  67. esac
  68.  
  69. exit $?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement