I’m writing a script to start Jboss, load an application, send requests to the application, shutdown jboss and repeat. However I dont know how to shut Jboss down from the script. At the moment I’m using
pkill -9 java
But I dont think this is right, because it kills the process, not shut it down. Is there a way to shut it down similar to pressing CTRL-C?
You want a simple
From the man page:
SIGTERMwill send a termination signal to the process. If the process is well-written, it will catch this signal and perform an orderly shutdown. If that fails, that’s when you can useSIGKILL(-9) which is a forceable termination with no chance for the process to catch and perform cleanup.