Discussion:
graceful restart tomcat
Kaushal Shriyan
2011-11-10 08:28:08 UTC
Permalink
Hi,

Is there a way to forcefully graceful restart tomcat server using bash
script via cron.Any sample bash script ?

Regards,

Kaushal
Pid
2011-11-10 09:12:48 UTC
Permalink
Post by Kaushal Shriyan
Hi,
Is there a way to forcefully graceful restart tomcat server using bash
script via cron.Any sample bash script ?
Which is it: forceful or graceful? The two are not usually compatible.

'graceful' is found in Apache HTTPD: [the] signal causes the parent
process to advise the children to exit after their current request (or
to exit immediately if they're not serving anything). The parent
re-reads its configuration files and re-opens its log files. As each
child dies off the parent replaces it with a child from the new
generation of the configuration, which begins serving new requests
immediately.

There is no equivalent for Tomcat.

The Commons Daemon found in tomcat/bin/commons-daemon-native.tar.gz
provides a service wrapper and /etc/init.d/ type sample script which may
be useful.


Why do you need to schedule Tomcat restarts? It is often a mitigation
applied instead of resolving the cause of a memory leak. Better to find
& fix the leak than leave it place.


p
Post by Kaushal Shriyan
Regards,
Kaushal
---------------------------------------------------------------------
--
[key:62590808]
Kaushal Shriyan
2011-11-10 09:25:59 UTC
Permalink
Post by Kaushal Shriyan
Hi,
Is there a way to forcefully graceful restart tomcat server using bash
script via cron.Any sample bash script ?
Which is it: forceful or graceful?  The two are not usually compatible.
'graceful' is found in Apache HTTPD: [the] signal causes the parent
process to advise the children to exit after their current request (or
to exit immediately if they're not serving anything). The parent
re-reads its configuration files and re-opens its log files. As each
child dies off the parent replaces it with a child from the new
generation of the configuration, which begins serving new requests
immediately.
There is no equivalent for Tomcat.
The Commons Daemon found in tomcat/bin/commons-daemon-native.tar.gz
provides a service wrapper and /etc/init.d/ type sample script which may
be useful.
Hi pid

I dont see commons-daemon-native.tar.gz under /opt/test/apache-tomcat-5.5.27/bin

catalina.sh commons-logging-api-1.1.1.jar digest.sh
jsvc.tar.gz setclasspath.sh startup.bat tomcat5w.exe
tool-wrapper.bat version.sh
[***@bin]# pwd
/opt/test/apache-tomcat-5.5.27/bin
[***@bin]# ls
bootstrap.jar catalina-tasks.xml cpappend.bat
jkstatus-tasks.xml service.bat shutdown.bat startup.sh
tomcat-juli.jar tool-wrapper.sh
catalina.bat commons-daemon.jar digest.bat
jmxaccessor-tasks.xml setclasspath.bat shutdown.sh tomcat5.exe
tomcat-native.tar.gz version.bat
catalina.sh commons-logging-api-1.1.1.jar digest.sh
jsvc.tar.gz setclasspath.sh startup.bat tomcat5w.exe
tool-wrapper.bat version.sh
[***@bin]#

Please suggest further.

Regards,

Kaushal

Loading...