For some reason allmost all the
init.d scripts for starting and stoping tomcat just calls tomcat's
shutdown.sh scripts. I am ok with that as far as they work. The startup script works just fine but when I want to restart or stop a tomcat instance, in most cases I have to just kill the process.
So what I need is a way to try stop tomcat with it's shutdown script, wait a little bit to see if tomcat shutdown and if not just kill the process. The script below does exactly that.
It would be much better to have a pid file at start time and use that one and not try to figure out the pid from ps. Maybe next version.