반응형
tomcat start script 입니다.
[서비스명] 을 변경해서 사용하면 됩니다.
SERVICE_NAME=서비스명
echo "Killing SERVICE_NAME: $SERVICE_NAME"
echo "Killing SERVICE ID: `ps -ef|grep -w D$SERVICE_NAME|grep -v grep|awk '{print $2}'`"
kill -9 `ps -ef|grep -w D$SERVICE_NAME|grep -v grep|awk '{print $2}'`
export JAVA_HOME=/svc/java/jdk1.8
export CATALINA_HOME=/svc/tomcat/tomcat8
export CLASSPATH=$CATALINA_HOME/lib/servlet-api.jar
export CATALINA_BASE=$CATALINA_HOME/$SERVICE_NAME
LOG_DIR="$CATALINA_HOME/$SERVICE_NAME/logs"
CATALINA_OUT="$LOG_DIR/$SERVICE_NAME.out"
prefix=`date +%Y%m%d%H%M`
mv $CATALINA_OUT $LOG_DIR/backup/$SERVICE_NAME.out_$prefix
GC_LOG_OUT="$LOG_DIR/gclogs/gc.log"
mv $GC_LOG_OUT $LOG_DIR/gclogs/backup/gc.log_$prefix
touch $CATALINA_OUT
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib
export LD_LIBRARY_PATH
exec $JAVA_HOME/bin/java \
-server \
-Xms256m -Xmx256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m \
-D$SERVICE_NAME \
-Djava.awt.headless=true \
-Djava.endorsed.dirs=$CATALINA_HOME/common/endorsed \
-classpath $CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/bin/commons-logging-api.jar:$CATALINA_HOME/bin/tomcat-juli.jar \
-Dcatalina.base="$CATALINA_BASE" \
-Dcatalina.home="$CATALINA_HOME" \
-verbose:gc \
-Xloggc:$LOG_DIR/gclogs/gc.log \
-XX:+PrintGCDetails \
-XX:+PrintGCTimeStamps \
org.apache.catalina.startup.Bootstrap "$@" start \
>> $CATALINA_OUT 2>&1 &
echo "Using SERVICE_NAME: $SERVICE_NAME"
echo "Using JAVA_HOME: $JAVA_HOME"
echo "Using CLASSPATH: $CLASSPATH"
echo "Using CATALINA_HOME: $CATALINA_HOME"
echo "Using CATALINA_BASE: $CATALINA_BASE"
echo "Using CATALINA_OUT: $CATALINA_OUT"
stop script 입니다.
SERVICE_NAME=서비스명
echo "Killing SERVICE_NAME: $SERVICE_NAME"
echo "Killing SERVICE ID: `ps -ef|grep -w D$SERVICE_NAME|grep -v grep|awk '{print $2}'`"
kill -9 `ps -ef|grep -w D$SERVICE_NAME|grep -v grep|awk '{print $2}'`
반응형
'리눅스' 카테고리의 다른 글
리눅스 maven 설치 (0) | 2018.01.08 |
---|---|
vi 한글 깨짐, 터미널 한글 깨짐 (0) | 2018.01.04 |
vmstat 메모리 사용률 (0) | 2017.11.28 |
tomcat 8 server.xml 탐캣8 (0) | 2017.11.14 |
엑셀 날짜 텍스트 변환 (0) | 2017.09.29 |
리눅스 /dev/random vs /dev/urandom (0) | 2017.09.23 |
리눅스 - 그룹 생성 (0) | 2017.09.12 |
리눅스 - sudo 다른 사람 계정으로 실행하기 (0) | 2017.08.23 |