Check to be sure the proper environment variables are set when the script runs. When I read the error message, I understand the error to be more like "I can't find rt.sh from line 1 of /usr/local/tomcat/bin/shutdown.sh". You can test to confirm that suspicion by just dropping in an echo line at the beginning of shutdown.sh to confirm it is finding shutdown.sh and is executing it's contents.

Also I'd be careful to put some sleep delay before the killall command as it can take a few seconds for tomcat to shutdown depending on how the webapps were designed.

--David

Piller Sébastien wrote:
Hello,

I have my application in production for a month now. I've some problem of memory leak that force me to restart TC each few days. I'm trying to automate this operation with a cron that runs a *.sh file. But I don't know how what to write in it. Actually, I've this:

/usr/local/tomcat/bin/shutdown.sh
killall -9 java
/usr/local/tomcat/bin/startup.sh

But when I run it using SSH, it makes a weird error:

[EMAIL PROTECTED] bin]# /usr/local/tomcat/bin/restart.sh
: No such file or directoryrt.sh: line 1:* /usr/local/tomcat/bin/shutdown.sh*
: no process killed
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:       /usr/java/jre1.5.0_06

... but shutdown.sh exists!

Does anybody have an example of a script that restart Tomcat?

Thanks a lot!


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to