Submitted On 28-OCT-2001
jerhewet
> We could use softer ExitProcess() call, which would allow
> to run shutdown hooks, but ExitProcess could block on
> stubborn processes. Since Process.destroy() is the last
> resort, using TerminateProcess() in it is justified.
So why not give us both options -- a Process.exit() that
calls ExitProcess() and a Process.destroy() that calls
TerminateProcess() to whack stubborn ones that don't
respond to exit()?
I've already had to write external code to work around the
bug you refuse to fix regarding console windows and the
SW_HIDE parameter. So now I have to waste even more time
figuring out how to work around your call to
TerminateProcess()?
Your own RMID and RMIREGISTRY applications are sterling
examples of why I'm having to jump through these hoops.
There isn't any way to cleanly stop them from the command
line, and I certainly don't want to exec() them directly
and have those damned DOS console windows cluttering up my
screen until I destroy() them.
Add a method to call ExitProcess(), fix the SW_HIDE
problem, and give us some way to stop RMID and RMIREGISTRY
from the command line.
Submitted On 11-DEC-2001
mnewcomb
That is wierd... I see the exact opposite behavior! My
subprocess registered shutdown hooks get called on Windows
NT, but not on Solaris!
I have a similar issue when using Ant (java build system
from Apache) to run processes. When I ctrl-C from Ant, I
want it to kill the subprocesses it is running with
Process.destroy(). I made a patch and a test case in which
a process is execed form Ant and that process registers a
shutdown hook with the VM.
When I run and hit ctrl-C, Ant's shutdown hook is called
and that calls Process.destroy() on all subprocesses. My
subprocesses get the message on Windows NT, but they don't
on unix-based JDKs (tried RedHat 7.2 and Solaris 7) both
with the same JDK you are using (1.3.1-b24).
How screwy is that? When I do a kill (which sends SIGTERM)
on the subprocess, my shutdown hooks get called. That
means that on unix-based JVMs, Process.destroy() is sending
SIGKILL because they aren't seeing the signal!
We both have the same JDK? What's up with that?
Submitted On 13-FEB-2002
simtt8
And I lose 5 hours on other NT behaviour:
if i start other VM using Runtime.exec indirectly: Runtime.exec("test.cmd"); (Test.cmd calls java.exe as
VM)
I CAN'T DESTROY second VM using process.destroy(); Then it apply only on CMD.EXE, but grandchild
process java.exe (menas VM) still active!!
Direct call of second VM using Runtime.Exec(..java.exe..) work completly correct related process.destroy() !
So poeple, have fun !
Submitted On 15-JUL-2003
conor
I don't think the "Not a bug" response is satisfactory.
Please see this Apache Ant bug report
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8510
In effect, we can't gracefully shutdown Java processes
launched from Ant on Windows. The platform specific
limitation seems at odds with Java's goals.
Submitted On 28-AUG-2007
uuklanger
This issue affects SystemTray and TrayIcon. A process that uses this needs to know when the JVM shutsdown so things link file, database, and network connections can be shutdown.
shutdownHook (or similar) needs to be available for all supported OS for when a user logs off or a system shutdown happens.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|