On our linux boxes, we have multiple users who run tomcat.
Currently we are using process kill commands to kill the respective user's tomcat , instead of using shutdown.sh
Are there any downsides of using this approach ?
On our linux boxes, we have multiple users who run tomcat.
Currently we are using process kill commands to kill the respective user's tomcat , instead of using shutdown.sh
Are there any downsides of using this approach ?
It depends on what kill
signal you are using:
If you use TERM
(the numeric equivalent is kill -15
), theoretically you are letting the java
process signal its children and exit in a correct way.
If you use KILL
(kill -9
), you don't, and you left all sorts of temporary files,
sockets, etc... behind.
That said, tomcat
has its own mechanism to shutdown properly, namely an RMI call which you should be using, either directly or by using your operating system's interface: service
, start
, systemctl
or any other.
If you can't do that for whatever reason, you could use some help from a wrapper like tanukiwrapper
or supervisord
, which also has a web frontend.
There is no difference in behaviour if you use Tomcat's shutdown script or use kill -15. The end result is exactly the same - a clean shutdown. The only difference is a slight difference in the code path that starts the shutdown process.