From 71c80e0ecfc35c5eae41cc1f26fc59e580d9f80f Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 23 Jul 2024 11:56:15 -0500 Subject: [PATCH] Issue #10904 Reorder pid and state file checks --- jetty-home/src/main/resources/bin/jetty.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/jetty-home/src/main/resources/bin/jetty.sh b/jetty-home/src/main/resources/bin/jetty.sh index 738bb8611847..618f11edd5f8 100755 --- a/jetty-home/src/main/resources/bin/jetty.sh +++ b/jetty-home/src/main/resources/bin/jetty.sh @@ -593,6 +593,18 @@ case "$ACTION" in testFileSystemPermissions + if running $JETTY_PID + then + echo "Already Running $(cat $JETTY_PID)!" + exit 1 + fi + + # remove any lingering state file + if [ -f $JETTY_STATE ] + then + rm $JETTY_STATE + fi + echo -n "Starting Jetty: " # Startup from a service file @@ -616,13 +628,6 @@ case "$ACTION" in -- (( DEBUG )) && echo "Starting: start-stop-daemon" else - - if running $JETTY_PID - then - echo "Already Running $(cat $JETTY_PID)!" - exit 1 - fi - # Startup if switching users (not as a service, or from root) if [ -n "$JETTY_USER" ] && [ `whoami` != "$JETTY_USER" ] then