Eugene Krel
sunmulA
- Joined
- 3/3/08
- Messages
- 399
- Points
- 28
I have gotten used to ending background processes by issuing sigterm, but recently I have been working on a java project that requires a bit of clean up on shutdown. The solution seemed to be to use shutdown hooks, but they appear to have a problem with threaded applications because the actual clean up process seems to vary from time to time in terms of how much of it actually takes place.
If i run the process in the foreground and send input to end the process it executes the clean up correctly and then also throws the hook and runs the clean up correctly.
How do you guys normally end bg processes gracefully?
If i run the process in the foreground and send input to end the process it executes the clean up correctly and then also throws the hook and runs the clean up correctly.
How do you guys normally end bg processes gracefully?