Travis Risner wrote:
>I am trying to kill a program via kill -QUIT <pid>. However, the signal is
>ignored, even when sent by root. An ordinary kill <pid> works fine. The
>program is started from a bash shell, which then invokes the JVM to start a
>Java program. I am trying to create a thread dump of the program (the
>reason for the -QUIT signal).
Are you sure the QUIT signal is being ignored, as opposed to the
thread-dump going somewhere you haven't discovered yet? That is, the
program could be producing the thread-dump, but if the output stream is
redirected, the data gets lost. Or the data gets written to a file, but
you don't know which file it's in.
If you add a couple of System.out.println() and System.err.println()
statements to your app, where does that output show up? Or does it not
show up at all?
Exactly how are you starting the app from a bash shell? Do you mean from a
shell script? In foreground or background? Using 'nohup'? Any other
redirection of I/O streams?
The Subject line says "started from the dock", so how does "from a bash
shell" fit with the Dock?
By the way, a QUIT signal will ONLY generate a thread-dump. It does NOT
terminate the Java program. So when you wrote "I am trying to kill a
program...", if you meant "generate a thread dump then terminate it", then
a QUIT signal will only do the former, not the latter.
A 'kill <pid>' sends a TERM signal, which is different from QUIT, which are
both different from INT, HUP, or KILL.
>Is this enough information to reproduce the problem? Is there a better
>forum to ask this question? Is there an alternative way to get a thread
>dump?
The ctrl-\ key sends the QUIT signal, if the program is still attached to a
terminal. However, if the app isn't attached to a terminal, or its output
is redirected, then it won't make a difference. Sending a QUIT signal from
a different origin doesn't address the issue of redirected output, assuming
that's the problem.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden