jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

jetty.sh reports FAILED too early

Open lonerook opened this issue 2 years ago • 1 comments

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

lonerook avatar Nov 19 '23 09:11 lonerook

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

amato-gianluca avatar Jun 30 '24 11:06 amato-gianluca

Are you using jetty setuid?

joakime avatar Jul 01 '24 14:07 joakime

My workaround is to always remove the jetty.state file before calling jetty.sh start.

lonerook avatar Jul 02 '24 04:07 lonerook

Are you using jetty setuid?

No, I am not using the jetty setuid.

amato-gianluca avatar Jul 02 '24 09:07 amato-gianluca

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.

amato-gianluca avatar Jul 02 '24 09:07 amato-gianluca

Opened PR #12081 to address this.

joakime avatar Jul 23 '24 16:07 joakime