brettwooldridge / NuProcess

Low-overhead, non-blocking I/O, external Process implementation for Java
Apache License 2.0
710 stars 84 forks source link

Keeping NuProcesses running after Java application exit? #135

Closed gagarski closed 2 years ago

gagarski commented 2 years ago

Is there an option to keep the started processes running even after the Java process exits. On Linux killing a parent does not mean that children also die, so I guess killing them is done by some NuProcess shutdown hooks. Doing kill -9 on a Java process confirms this guess by leaving the processes running (at first glance it seems that they do not suffer from the output streams not being consumed by anyone (unlike standard Java Processes) but the tests I did were quite simple). Can I achieve the same behavior when using graceful shutdown (like SIGTERM or just System.exit)? Or are there problems which I don't see now?

gagarski commented 2 years ago

com.zaxxer.nuprocess.enableShutdownHook property seems to be doing the thing