문제

I would like to terminate the Java application when 'kill -s 3 ' is executed. But Java dumps the thread information instead. Do I need to use different kill signal?

도움이 되었습니까?

해결책

According to JVMs and kill signals, the ShutdownHook is not run and the jvm is not shutdown when using signal SIGQUIT (3). Just use the default signal SIGTERM (15).

다른 팁

whats wrong with just kill? it shold send the default signal, SIGTERM

take a look at this: How to stop java process gracefully?

kill -3 or kill -s 3 will always generate the thread dump.

In general programming, finalizer and shutdownhooks should not be used.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top