BLOG main image
분류 전체보기 (111)
주절주절 (16)
Tabex (4)
클라우드 관련 (12)
Linux (23)
CruiseControl (3)
XP (1)
C (4)
C++ (1)
C# (2)
Boost (3)
Java (0)
DataBase (4)
Algorithm (17)
Network (1)
OS (1)
UML (1)
상식 (3)
좋은 글 (3)
회사에서... (0)
Node.js (1)
EKS (1)
Mac (2)
Visitors up to today!
Today hit, Yesterday hit
daisy rss
tistory 티스토리 가입하기!
'톰켓 서비스'에 해당되는 글 1건
2012. 1. 3. 17:45
출처 :  http://www.spaceprogram.com/knowledge/2004/01/starting-tomcat-as-service-on-linux.html 

# vim /etc/init.d/tomcatd


# This is the init script for starting up the

# Jakarta Tomcat server

#

# chkconfig: 345 91 10

# description: Starts and stops the Tomcat daemon.

#

# Source function library.

 . /etc/rc.d/init.d/functions

# Get config.

 . /etc/sysconfig/network

# Check that networking is up.

 [ "${NETWORKING}" = "no" ] && exit 0

 tomcat=/usr/local/tomcat6

 startup=$tomcat/bin/startup.sh

 shutdown=$tomcat/bin/shutdown.sh

 CATALINA_HOME=/usr/local/tomcat6; export CATALINA_HOME

 JAVA_HOME=/usr/java/jdk1.6.0_29; export JAVA_HOME

 start(){

  echo -n $"Starting Tomcat service: "

  #daemon -c

  $startup

  RETVAL=$?

  echo

 }

 stop(){

  action $"Stopping Tomcat service: " $shutdown

  RETVAL=$?

  echo

 }

 status(){

  numproc=`ps -ef | grep catalina | grep -v "grep catalina" | wc -l`

  if [ $numproc -gt 0 ]; then

  echo "Tomcat is running..."

  else

  echo "Tomcat is stopped..."

  fi

 }

 restart(){

   stop

   start

 }

 # See how we were called.

 case "$1" in

 start)

  start

  ;;

 stop)

  stop

  ;;

 status)

  status
 ;;

 restart)

  restart

  ;;

 *)

  echo $"Usage: $0 {start|stop|status|restart}"

  exit 1

 esac

 exit 0

prev"" #1 next