Is there a way to "gracefully" shutdown tomcat when controlling via supervisor?
My understanding is Tomcat's shutdown.sh script talks to tomcat on the shutdown port to initiate a graceful shutdown. Supervisor doesn't seem to have a way to specify a shutdown "command", only using signals.
Has anyone successfully used supervisor with tomcat?
Also, since tomcat's startup.sh script initiates the java process, I've been copying the resulting java command directly into supervisor, but this isn't as nice as using the startup.sh script because of all the environment setup. Is there a way to get supervisor to use the startup.sh script but still track the resulting child java process?
Best Answer
Thanks to Mark for the link to that script; here is my working example for CentOS:
And here is what I used in /etc/supervisord.conf:
Running, it looks like this:
I tried initially to add those environment variables into /etc/supervisord.conf through the
environment
directive, but ran into trouble with the JAVA_OPTS, with all the spaces and equal signs. Putting it in the wrapper script took care of that.Hope this helps save someone else some time!