Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I stop the spawned process in jetty 7 using jetty.sh?

I am using Jetty 7.4 for one of my projects. I need to configure it so that it can start/stop automatically whenever the server starts up or goes down. Also, I should be able to start/stop the server on demand. I am using the start/stop script that comes along with jetty(bin/jetty.sh). The server starts just fine. However, when it comes to stopping the server, I am facing some problems.

Jetty expects you to start the server with "--exec" command line parameter and this parameter spawns another JVM instance. Now there are two processes running for jetty. When you try to stop the jetty server using the script the first process dies successfully. However, I can still see the spawned process.

I've searched the web and people have asked this question at multiple places but I could not find a solution to this problem. Any ideas?

thanks,

NG

like image 402
systemboot Avatar asked Nov 13 '22 22:11

systemboot


1 Answers

This doesn't really answer the question, but I worked around this by specifying JVM options in a new file in /etc/default/jetty. There you can set JVM options using something like this:

JAVA_OPTIONS="-XX:MaxPermSize=128m -Xms1024m -Xmx1024m"

Then you won't have to spawn another process using --exec and you can just use jetty.sh to start and stop the one process normally.

like image 86
Bart Avatar answered Nov 17 '22 06:11

Bart