Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jetty.sh reports FAILED too early #10904

Closed
lonerook opened this issue Nov 19, 2023 · 6 comments · Fixed by #12081
Closed

jetty.sh reports FAILED too early #10904

lonerook opened this issue Nov 19, 2023 · 6 comments · Fixed by #12081
Labels
Bug For general bugs on Jetty side

Comments

@lonerook
Copy link

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 lonerook added the Bug For general bugs on Jetty side label Nov 19, 2023
@amato-gianluca
Copy link

amato-gianluca commented Jun 30, 2024

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

@joakime
Copy link
Contributor

joakime commented Jul 1, 2024

Are you using jetty setuid?

@lonerook
Copy link
Author

lonerook commented Jul 2, 2024

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

@amato-gianluca
Copy link

Are you using jetty setuid?

No, I am not using the jetty setuid.

@amato-gianluca
Copy link

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.

@joakime
Copy link
Contributor

joakime commented Jul 23, 2024

Opened PR #12081 to address this.

joakime added a commit that referenced this issue Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants