I am having some issues with a Tomcat application server. Before I can get to fixing the problem with the Java application, I need to come up with a cron shell script to restart the server.
I thought this would be a simple endeavor, but the one complication is that the root cause makes Tomcat not shutdown cleanly after executing ./shutdown.sh. The process is still open when I run ps auwwx | grep java | grep org.apache.catalina.startup.Bootstrap
I kill -9 the process (yes, that's bad, but things do come up ok - so far ;) ) and I can restart the server correctly.
I'm not a shell script expert (or novice for that matter) and I need some help with "polling" for a period of time until the ps command above returns null. After a polling period I would do a kill, then a restart.