Issue
What is the best way to stop a Grails application started with:
nohup java -jar myapp.war --server-port=9090 &
Solution
Get the process ID:
ps -A | grep java
If the process id 3114
for example, then stop the process:
kill 3114
Sometimes, Grails app doesn't kill cleanly, then use:
kill -9 3114
Optionally, in one of your action in the controller, you can simply write:
System.exit()
This is the convenient way to shutdown your Grails application which will properly execute all your Shutdown hooks and will cleanly shutdown your app by preventing memory links, releasing resources, closing any streams extra.
https://stackoverflow.com/a/3716015/2405040
Answered By - Shashank Agrawal Answer Checked By - Mildred Charles (WPSolving Admin)