Starting tomcat on bootup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



#!/bin/sh
#
# tomcat:       Starts the Jakarta tomcat server
#
# Version:      @(#) /etc/init.d/tomcat 1.0
#
# chkconfig: 2345 55 45
# description: Starts and stops the Jakarta tomcat server at boot time 
and shutdown.
#
# processname: tomcat

# Source function library.
. /etc/init.d/functions

start() {
   echo -n $"Starting tomcat: "
   su - tomcat -c '$CATALINA_HOME/bin/startup.sh'
   ret=$?
   [ $ret -eq 0 ] && (touch /var/lock/subsys/tomcat; echo_success)
   echo
   return $ret
}

stop() {
   echo -n $"Shutting down tomcat: "
   su - tomcat -c '$CATALINA_HOME/bin/shutdown.sh'
   ret=$?
   [ $ret -eq 0 ] && rm -f /var/lock/subsys/tomcat
   echo
   return $ret
}

rhstatus() {
   status tomcat
}

reload() {
   if [ -f /var/lock/subsys/tomcat ]; then
      echo -n $"Reloading tomcat: "
      killproc tomcat -USR1
      ret=$?
      echo
      return $ret
   else
      stop
      start
   fi
}

restart() {
   echo $"Restarting tomcat:"
   stop
   start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
    restart
    ;;
  reload)
        reload
        ;;
  condrestart)
        [ -f /var/lock/subsys/tomcat ] && reload || :
        ;;
  status)
        rhstatus
        ;;
  *)
        echo $"*** Usage: tomcat 
{start|stop|status|restart|reload|condrestart}"
        exit 1
esac

exit $?

-- 
[ ]s,
LRU #391067
Analista de Rede
Leandro Costa
:wq
...... __@
...._ \ >_
...(_)/ (_)_________


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux