Skip to content

Commit

Permalink
Create sop.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
essential2189 authored Feb 4, 2024
1 parent e97f82f commit 1f450e1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/sop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

ROOT_PATH="/home/ubuntu/todaypopup"
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 1f450e1

Please sign in to comment.