Skip to content

Commit

Permalink
fix: move rm -fr $SERVICE_NAME".jar" after existProcessUsePort check
Browse files Browse the repository at this point in the history
  • Loading branch information
Anilople committed Apr 22, 2023
1 parent b26975f commit 930b1c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions apollo-adminservice/src/main/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ fi
if [[ -n "$APOLLO_RUN_MODE" ]] && [[ "$APOLLO_RUN_MODE" == "Docker" ]]; then
exec $javaexe -Dsun.misc.URLClassPath.disableJarChecking=true $JAVA_OPTS -jar $PATH_TO_JAR
else
if [[ -f $SERVICE_NAME".jar" ]]; then
rm -rf $SERVICE_NAME".jar"
fi

# before running check there is another process use port or not
if existProcessUsePort; then
if isServiceRunning; then
Expand All @@ -178,6 +174,9 @@ else

printf "$(date) ==== $SERVICE_NAME Starting ==== \n"

if [[ -f $SERVICE_NAME".jar" ]]; then
rm -rf $SERVICE_NAME".jar"
fi
ln $PATH_TO_JAR $SERVICE_NAME".jar"
chmod a+x $SERVICE_NAME".jar"
./$SERVICE_NAME".jar" start
Expand Down
7 changes: 3 additions & 4 deletions apollo-configservice/src/main/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ fi
if [[ -n "$APOLLO_RUN_MODE" ]] && [[ "$APOLLO_RUN_MODE" == "Docker" ]]; then
exec $javaexe -Dsun.misc.URLClassPath.disableJarChecking=true $JAVA_OPTS -jar $PATH_TO_JAR
else
if [[ -f $SERVICE_NAME".jar" ]]; then
rm -rf $SERVICE_NAME".jar"
fi

# before running check there is another process use port or not
if existProcessUsePort; then
if isServiceRunning; then
Expand All @@ -178,6 +174,9 @@ else

printf "$(date) ==== $SERVICE_NAME Starting ==== \n"

if [[ -f $SERVICE_NAME".jar" ]]; then
rm -rf $SERVICE_NAME".jar"
fi
ln $PATH_TO_JAR $SERVICE_NAME".jar"
chmod a+x $SERVICE_NAME".jar"
./$SERVICE_NAME".jar" start
Expand Down
7 changes: 3 additions & 4 deletions apollo-portal/src/main/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ fi
if [[ -n "$APOLLO_RUN_MODE" ]] && [[ "$APOLLO_RUN_MODE" == "Docker" ]]; then
exec $javaexe -Dsun.misc.URLClassPath.disableJarChecking=true $JAVA_OPTS -jar $PATH_TO_JAR
else
if [[ -f $SERVICE_NAME".jar" ]]; then
rm -rf $SERVICE_NAME".jar"
fi

# before running check there is another process use port or not
if existProcessUsePort; then
if isServiceRunning; then
Expand All @@ -178,6 +174,9 @@ else

printf "$(date) ==== $SERVICE_NAME Starting ==== \n"

if [[ -f $SERVICE_NAME".jar" ]]; then
rm -rf $SERVICE_NAME".jar"
fi
ln $PATH_TO_JAR $SERVICE_NAME".jar"
chmod a+x $SERVICE_NAME".jar"
./$SERVICE_NAME".jar" start
Expand Down

0 comments on commit 930b1c6

Please sign in to comment.