How to handle a SIGTERM

Martijn Courteaux picture Martijn Courteaux · Jun 4, 2010 · Viewed 43.8k times · Source

Is there a way in Java to handle a received SIGTERM?

Answer

Matthew Flaschen picture Matthew Flaschen · Jun 4, 2010

Yes, you can register a shutdown hook with Runtime.addShutdownHook().