Skip to content

Commit

Permalink
Create stop.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jwnnoh authored Aug 27, 2023
1 parent 1c17660 commit 78db7e0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

ROOT_PATH="/home/ubuntu/Reminiscence-BE"
JAR="$ROOT_PATH/application.jar"
STOP_LOG="$ROOT_PATH/stop.log"
SERVICE_PID=$(pgrep -f $JAR) # 실행중인 Spring 서버의 PID

if [ -z "$SERVICE_PID" ]; then
echo "서비스 NouFound" >> $STOP_LOG
else
echo "서비스 종료 " >> $STOP_LOG
kill "$SERVICE_PID"
# kill -9 $SERVICE_PID # 강제 종료를 하고 싶다면 이 명령어 사용
fi

0 comments on commit 78db7e0

Please sign in to comment.