톰캣 시작 스크립트

/etc/init.d/tomcat

#!/bin/sh
tomcat=usr/local/tomcat/tomcat-6.0.35
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh

start() {
  echo -n $”Starting Tomcat service: “
  sh $startup
  echo $?
}

stop() {
  echo -n $”Stopping Tomcat service: “
  sh $shutdown
  echo $?
}

restart() {
  stop
  start
}

status() {
  ps -aef | grep tomcat | grep -v grep
}

# Handle the different input options
case “$1” in
start)
  start
  ;;
stop)
  stop
  ;;
status)
  status
  ;;
restart)
  restart
  ;;
*)
  echo $”Usage: $0 {start|stop|restart|status}”
  exit 1
esac

exit 0

해당 파일 등록 후 service tomcat restart 로 톰캣 재시작 가능

답글 남기기

이메일 주소는 공개되지 않습니다.