jetty.project
jetty.project copied to clipboard
jetty.sh reports FAILED too early
Jetty version(s) 12.0.3
Jetty Environment ee10
Java version/vendor (use: java -version)
17.0.9
OS type/version Debian 12.2
Description
Repeatedly starting and stopping jetty using the jetty.sh script, it sometimes happens that jetty.sh start reports FAILED. This seems to be because the started() function in the shell script is run too fast, while an old jetty.state file has not yet been overwritten and has STOPPED as its last line (from the previous run of jetty).
How to reproduce?
Run jetty.sh start. Then stop it using the shell script. Then start again. Repeat a few times and it will happen sooner or later
Jetty version(s) 12.0.10
Jetty Environment ee9
Java version/vendor (use: java -version) 17.0.11
OS type/version Rocky Linux 9
This happens to me systematically with Jetty 12.0.10 at every reboot. I had to add a sleep 5 command before the line
if expr -- "${JETTY_ARGS[*]}" : '.*jetty\.state=.*' > /dev/null
in jetty.sh. My /etc/default/jetty is the following:
JETTY_HOME=/opt/jetty
JETTY_USER=jetty
JETTY_BASE=/opt/jetty-base
JETTY_RUN=/opt/jetty-base/tmp
Are you using jetty setuid?
My workaround is to always remove the jetty.state file before calling jetty.sh start.
Are you using jetty setuid?
No, I am not using the jetty setuid.
My workaround is to always remove the jetty.state file before calling
jetty.sh start.
I am going to adopt your workaround too, seems more robust than mine.
Opened PR #12081 to address this.