Glory to Russia
Glory to Russia

Reputation: 18712

How do I kill a Java application on Linux so that the shutdown hook is executed?

I'm using Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-85-generic x86_64).

The application is launched with nohup and usually runs all the time. Up to know I used kill to stop it, but I'm not sure the shutdown hooks are executed that way.

How do I properly shut down the application so that the shutdown hooks are activated?

Upvotes: 2

Views: 516

Answers (1)

GauravJ
GauravJ

Reputation: 2262

You should not kill you application using kill -9 javaapp instead use SIGTERM which is kill -15 javaapp See this.

Upvotes: 4

Related Questions