Skip to content

Commit

Permalink
Update start.sh - Kill exist process
Browse files Browse the repository at this point in the history
  • Loading branch information
yummygyudon authored Nov 17, 2023
1 parent 26a6175 commit e41a4af
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion script/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ REPOSITORY=/home/ubuntu/$DEFAULT_PATH
JAR_NAME=$(ls $REPOSITORY/build/libs/ | grep '.jar' | tail -n 1)
JAR_PATH=$REPOSITORY/build/libs/$JAR_NAME

echo "> ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ pid ํ™•์ธ"
JAR_PID=$(pgrep -f $JAR_NAME)

if [ -z $JAR_PID ]
then
echo "> ํ˜„์žฌ ๊ตฌ๋™์ค‘์ธ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์—†์œผ๋ฏ€๋กœ ์ข…๋ฃŒํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค."
else
echo "> kill -15 $JAR_PID"
kill -15 $JAR_PID
sleep 10
fi

echo "> $JAR_PATH ๋ฐฐํฌ" #3
nohup java -jar -Dspring.profiles.active=$PROFILE $REPOSITORY/build/libs/app-server-0.0.1-SNAPSHOT.jar >nohup.out 2>&1 </dev/null &
nohup java -jar -Dspring.profiles.active=$PROFILE $REPOSITORY/build/libs/app-server-0.0.1-SNAPSHOT.jar >nohup.out 2>&1 </dev/null &

0 comments on commit e41a4af

Please sign in to comment.