tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: tomcat daily restart
Date Tue, 01 Jun 2004 20:03:40 GMT

Well, you're killing all java processes.  That seems a bit excessive, especially running as
root since you WILL kill other people's jobs.

You didn't specify your tomcat version.  Assuming it's from within the last year, there is
a catalina-pid option you can set in $CATALINA_HOME/bin/  If set, the process
ID (PID) of the tomcat server will be written to the file specified in that attribute.  Your
script would then look for this file and kill the PID specified in the file.  You could run
this script as the tomcat server user, you don't need to be root, and your overall setup would
be more secure and more robust.

Yoav Shapira
Millennium Research Informatics

>-----Original Message-----
>From: Marco Pöhler []
>Sent: Tuesday, June 01, 2004 4:01 PM
>To: tomcat-user
>Subject: tomcat daily restart
>somewhere in my web application is a memory leak, and the tomcat hangs
>a week and /etc/init.d/tomcat stop won't work also. The application will be
>rewritten, so it is not important to find the leak. I'm currently think it
>is okay to restart the tomcat every night. I wrote the simple shell script
>below to do the job. The script is started as cronjob by root. The Script
>works, but my question is: Are there better solutions ? Are there any
>pitfalls I havn't seen ?
>kill -9 `ps ax | grep java | awk '{ print $1 }'`
>/etc/init.d/tomcat start
>thanks in advance
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message