Skip to content

Commit

Permalink
Fix possible bailing out when monit restarts
Browse files Browse the repository at this point in the history
The script bailed out when:
- the PID file was missing
- the PID couldn't be killed
  • Loading branch information
dr0i committed Sep 26, 2022
1 parent 6ad34aa commit 64d00d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/monit_restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ JAVA_OPTS=$(echo "$JAVA_OPTS" |sed 's#,#\ #g')
cd $HOME/git/$REPO
case $ACTION in
start)
rm target/universal/stage/RUNNING_PID
if [ -f target/universal/stage/RUNNING_PID ]; then
kill $(cat target/universal/stage/RUNNING_PID)
rm target/universal/stage/RUNNING_PID
fi
JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError" $HOME/activator-dist-1.3.5/activator "start $PORT"
;;
stop)
Expand Down

0 comments on commit 64d00d1

Please sign in to comment.