First get the process id using
ps | grep java
then send the quit signal
kill -QUIT <your-pid>
But this was not working for me on my server running Jetty 6.1 as installed by the .deb installation. The logs showed nothing.
After a bit of searching on the interweb I found the new (to me) method of generating stack traces using
sudo jstack <pid>
This was slightly more helpful and told me:
"Unable to open socket file: target process not responding or HotSpot VM not loaded"
At last I had something to go on and found that jstack must be run as the same user as the java process - which in the case of Jetty as installed by the debian install files is "jetty"
sudo -u jetty jstack <your-pid>
worked a treat and so did
sudo -u jetty kill -QUIT <your-pid>
1 comment:
Thanks. jstack was new to me too until I read this post. I was using kill -3 to view jettys threads and expecting to see the dump in one of the log files but no, it dumped itself at my colleagues terminal window because he was the one who started the process. jstack does the job, and writes the stack to my stdout. That has saved me from hacking the start script to capture the output to a log file.
Post a Comment