Merge pull request #12081 from jetty/fix/12.0.x/jetty-sh-state-checks

Issue #10904 Reorder pid and state file checks
This commit is contained in:
Joakim Erdfelt 2024-07-23 20:09:36 -05:00 committed by GitHub
commit eded329621
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 7 deletions

View File

@ -593,6 +593,18 @@ case "$ACTION" in
testFileSystemPermissions 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: " echo -n "Starting Jetty: "
# Startup from a service file # Startup from a service file
@ -616,13 +628,6 @@ case "$ACTION" in
-- --
(( DEBUG )) && echo "Starting: start-stop-daemon" (( DEBUG )) && echo "Starting: start-stop-daemon"
else 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) # Startup if switching users (not as a service, or from root)
if [ -n "$JETTY_USER" ] && [ `whoami` != "$JETTY_USER" ] if [ -n "$JETTY_USER" ] && [ `whoami` != "$JETTY_USER" ]
then then