Re: Tomcat graceful shutdown inquiry
Fantastic. Thanks! :) On Tue, Jun 28, 2016 at 2:43 PM, Mark Thomas wrote: > On 28/06/2016 19:39, Coty Sutherland wrote: >> Hello all, >> >> I've been poking around with the Fedora distribution of tomcat and >> noticed that systemd isn't allowing tomcat to gracefully shutdown (it >> sends an immediate SIGKILL after the Boostrap stop is called). That >> isn't your issue, but in trying to mediate the issue so that session >> persistence works as expected, I found that SIGTERM causes tomcat to >> gracefully shutdown. Looking at the code of the >> org.apache.catalina.startup.Bootstrap.stop() method, I can see that it >> hands off to Server.stop() and stops the server by initiating the >> shutdown hook, etc. When you send a SIGTERM to tomcat the >> org.apache.catalina.core.StandardServer.stopInternal() method is what >> handles shutdown and appears to be gracefully stopping the server, >> though it goes about the process a bit differently. >> >> My question is, can anyone readily tell me the functional difference >> between gracefully handling a SIGTERM and utilizing Bootstrap.stop()? > > None. > >> I'm sure that the Bootstrap.stop() is the preferred method, > > Not really. > >> but is there any major harm in using SIGTERM? > > No. > >> I've compared FINE level >> logging on org.apache and both methods seem to get the same result (a >> graceful stop). > > They are equivalent. If you disable the shutdown port, SIGTERM is the > only way to gracefully shut down Tomcat. > > Mark > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat graceful shutdown inquiry
On 28/06/2016 19:39, Coty Sutherland wrote: > Hello all, > > I've been poking around with the Fedora distribution of tomcat and > noticed that systemd isn't allowing tomcat to gracefully shutdown (it > sends an immediate SIGKILL after the Boostrap stop is called). That > isn't your issue, but in trying to mediate the issue so that session > persistence works as expected, I found that SIGTERM causes tomcat to > gracefully shutdown. Looking at the code of the > org.apache.catalina.startup.Bootstrap.stop() method, I can see that it > hands off to Server.stop() and stops the server by initiating the > shutdown hook, etc. When you send a SIGTERM to tomcat the > org.apache.catalina.core.StandardServer.stopInternal() method is what > handles shutdown and appears to be gracefully stopping the server, > though it goes about the process a bit differently. > > My question is, can anyone readily tell me the functional difference > between gracefully handling a SIGTERM and utilizing Bootstrap.stop()? None. > I'm sure that the Bootstrap.stop() is the preferred method, Not really. > but is there any major harm in using SIGTERM? No. > I've compared FINE level > logging on org.apache and both methods seem to get the same result (a > graceful stop). They are equivalent. If you disable the shutdown port, SIGTERM is the only way to gracefully shut down Tomcat. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat graceful shutdown inquiry
Hello all, I've been poking around with the Fedora distribution of tomcat and noticed that systemd isn't allowing tomcat to gracefully shutdown (it sends an immediate SIGKILL after the Boostrap stop is called). That isn't your issue, but in trying to mediate the issue so that session persistence works as expected, I found that SIGTERM causes tomcat to gracefully shutdown. Looking at the code of the org.apache.catalina.startup.Bootstrap.stop() method, I can see that it hands off to Server.stop() and stops the server by initiating the shutdown hook, etc. When you send a SIGTERM to tomcat the org.apache.catalina.core.StandardServer.stopInternal() method is what handles shutdown and appears to be gracefully stopping the server, though it goes about the process a bit differently. My question is, can anyone readily tell me the functional difference between gracefully handling a SIGTERM and utilizing Bootstrap.stop()? I'm sure that the Bootstrap.stop() is the preferred method, but is there any major harm in using SIGTERM? I've compared FINE level logging on org.apache and both methods seem to get the same result (a graceful stop). TIA, Coty - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org