hi experts<br><br>i have Ubuntu dapper with j2sdk1.5<br><br>i downloaded apache-tomcat-5.5.17 and unzipped into usr/local/<br>i have downloaded tomcat5 script for auto starting tomcat and easy start stop and status checking of tomcat.<br><br>i have some problems<br>1. when i execute the script <br> /etc/init.d/tomcat5 start . i get the err mess as<br>Starting Tomcat 5 servlet engine using Java from /usr/lib/j2sdk1.5-sun: cat: /etc/tomcat5/policy.d/*.policy: No such file or directory<br><br>actually there is no such directory in etc/init.d.i guess its created when tomcat is installed using apt-get tool.<br>the read the script .its copying the contents of these files to the <br>CATALINA_HOME(/usr/local/tomcat5517)/conf/catalina.polify file<br><div id="intelliTxt" style="padding-left: 5px; padding-right: 5px;"><br>pls help how can i make this script work i like this script bcos this script kills tomcat process <br>after timeout 0f 30 secs(or as specified in
script)<br>i have posted the script below(pls check)<br><br>Problem No 2:<br>----------------------------------------<wbr>----------<wbr>-------<br> when i sart tomcat i get this mess abt AprLifecycleListener lifecycleEvent optimizing <br>tomcats performance.pls tell what can i do to optimize tomcat<br><br>root@ublueshoe:/usr/local/tomcat/bin# ./catalina.sh run &<br>[3] 25004<br>Using CATALINA_BASE: /usr/local/tomcat<br>Using CATALINA_HOME: /usr/local/tomcat<br>Using CATALINA_TMPDIR: /usr/local/tomcat/temp<br>Using JRE_HOME: /usr/lib/j2sdk1.5-sun<br>root@ublueshoe:/usr/local/tomcat/bin# Aug 25, 2006 10:34:38 AM org.apache.catalina.core.AprLifecycleLis<wbr>tener lifecycleEvent<br>INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
/usr/lib/j2sdk1.5-sun/jre/lib/i386/clien<wbr>t:/usr/lib<wbr>/j2sdk1.5-<wbr>sun/jre/li<wbr>b/i386:/us<wbr>r/lib/j2sd<wbr>k1.5-sun/j<wbr>re/../lib/<wbr>i386<br>Au<br><br>Problem No 3<br>----------------------------------------<wbr>----------<br>when i shutdown tomcat i get thsi error mess as failed to shutdown pls help<br><br>root@ublueshoe:/usr/local/tomcat/bin# ./catalina.sh stop<br>Using CATALINA_BASE: /usr/local/tomcat<br>Using CATALINA_HOME: /usr/local/tomcat<br>Using CATALINA_TMPDIR: /usr/local/tomcat/temp<br>Using JRE_HOME: /usr/lib/j2sdk1.5-sun<br>Aug 25, 2006 4:49:02 AM org.apache.coyote.http11.Http11BaseProto<wbr>col pause<br>INFO: Pausing Coyote HTTP/1.1 on http-8080<br>root@ublueshoe:/usr/local/tomcat/bin# Aug 25, 2006 4:49:03 AM org.apache.catalina.core.StandardService stop<br>INFO: Stopping service Catalina<br>Aug 25, 2006 4:49:03 AM org.apache.coyote.http11.Http11BaseProto<wbr>col destroy<br>INFO: Stopping Coyote HTTP/1.1 on
http-8080<br>Aug 25, 2006 4:49:03 AM org.apache.catalina.core.AprLifecycleLis<wbr>tener lifecycleEvent<br>INFO: Failed shutdown of Apache Portable Runtime<br><br><br><br><br>The tomcat startup script <br>----------------------------------------<wbr>----------<wbr>---<br><br>#! /bin/sh -e<br>#<br># /etc/init.d/tomcat5 -- startup script for the Tomcat 5 servlet engine<br>#<br># Written by Miquel van Smoorenburg <miquels@cistron.nl>.<br># Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.<br># Modified for Tomcat by Stefan Gybas <sgybas@debian.org>.<br><br>PATH=/usr/local/sbin:/usr/local/bin:/sbi<wbr>n:/bin:/us<wbr>r/sbin:/us<wbr>r/bin<br>NAME=tomcat5<br>DESC="Tomcat 5 servlet engine"<br>CATALINA_HOME=/usr/local/tomcat5517<br>DAEMON=$CATALINA_HOME/bin/catalina.sh<br>DEFAULT=/etc/default/$NAME<br><br># The following variables can be overwritten in $DEFAULT<br><br># Run Tomcat 5 as this user
ID<br>TOMCAT5_USER=root<br><br># The first existing directory is used for JAVA_HOME (if JAVA_HOME is not<br># defined in $DEFAULT)<br>JDK_DIRS="/usr/lib/j2sdk1.5-sun"<br><br># Directory for per-instance configuration files and webapps<br>CATALINA_BASE=/usr/local/tomcat5517<br># Use the Java security manager? (yes/no)<br>TOMCAT5_SECURITY=yes<br><br># Timeout in seconds for the shutdown of all webapps<br>TOMCAT5_SHUTDOWN=30<br><br># End of variables that can be overwritten in $DEFAULT<br><br># overwrite settings from default file<br>if [ -f "$DEFAULT" ]; then<br> . "$DEFAULT"<br>fi<br><br>test -f $DAEMON || exit 0<br><br>if [ `id -u` -ne 0 ]; then<br> echo "Not starting/stopping $DESC, you are not root."<br> exit 4<br>fi<br><br>if [ -z "$TOMCAT5_USER" ]; then<br> echo "Not starting/stopping $DESC as configured (TOMCAT5_USER
is"<br> echo "empty in $DEFAULT)."<br> exit 0<br>fi<br><br># Look for the right JVM to use<br>for jdir in $JDK_DIRS; do<br> if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then<br> JAVA_HOME_TMP="$jdir"<br> # checks for a real JDK like environment, needed to check if <br> # really the java-gcj-compat-dev package is installed<br> if [ -r "$jdir/bin/jdb" ]; then<br> JAVA_HOME="$JAVA_HOME_TMP"<br> fi<br> fi<br>done<br>export JAVA_HOME<br><br># Set java.awt.headless=true if CATALINA_OPTS is not set so the<br>#
Xalan XSL transformer can work without X11 display on JDK 1.4+<br># It also looks like the default heap size of 64M is not enough for most cases<br># so the maximum heap size is set to 128M<br>if [ -z "$CATALINA_OPTS" ]; then<br> CATALINA_OPTS="-Djava.awt.headless=true -Xmx128M"<br>fi<br><br># Set the JSP compiler if set in the tomcat5.default file<br>if [ -n "$JSP_COMPILER" ]; then<br> CATALINA_OPTS="$CATALINA_OPTS -Dbuild.compiler=$JSP_COMPILER"<br>fi<br><br># Define other required variables<br>CATALINA_PID="$CATALINA_BASE/temp/$NAME.<wbr>pid"<br>STARTUP_OPTS=""<br>if [ "$TOMCAT5_SECURITY" = "yes" ]; then<br> STARTUP_OPTS="-security"<br>fi<br><br># Look for Java Secure Sockets Extension (JSSE) JARs<br>if [ -z "${JSSE_HOME}" -a -r "${JAVA_HOME}/jre/lib/jsse.jar" ]; then<br> JSSE_HOME="${JAVA_HOME}/jre/"<br>fi<br><br>export CATALINA_HOME CATALINA_BASE CATALINA_OPTS
CATALINA_PID JSSE_HOME<br><br>case "$1" in<br> start)<br> if [ -z "$JAVA_HOME" ]; then<br> echo "Could not start $DESC because no Java Development Kit"<br> echo "(JDK) was found. Please download and install JDK 1.3 or higher and set"<br> echo "JAVA_HOME in $DEFAULT to the JDK's installation directory."<br> exit 0<br> fi<br><br> if [ ! -d "$CATALINA_BASE/conf" ]; then<br> echo "Not starting Tomcat 5: Invalid CATALINA_BASE specified in $DEFAULT"<br> exit 1<br> fi<br><br> echo -n "Starting $DESC using Java
from $JAVA_HOME: "<br><br> if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \<br> --user $TOMCAT5_USER --startas "$JAVA_HOME/bin/java" \<br> >/dev/null; then<br><br> # Create catalina.policy (for the security manager)<br> rm -f "$CATALINA_BASE/conf/catalina.policy"<br> umask 022<br> echo "// AUTO-GENERATED FILE -- DO NOT EDIT!" \<br> > "$CATALINA_BASE/conf/catalina.policy"<br> echo "// Edit the files in /etc/tomcat5/policy.d/ instead" \<br>
>> "$CATALINA_BASE/conf/catalina.policy"<br> echo "" >> "$CATALINA_BASE/conf/catalina.policy"<br> cat /etc/tomcat5/policy.d/*.policy \<br> >> "$CATALINA_BASE/conf/catalina.policy"<br><br> # Clean up and set permissions on required files<br> rm -rf "$CATALINA_BASE"/temp/* \<br> "$CATALINA_BASE/logs/catalina.out"<br> mkfifo -m700 "$CATALINA_BASE/logs/catalina.out"<br> chown --dereference "$TOMCAT5_USER"
"$CATALINA_BASE/conf" \<br> "$CATALINA_BASE/conf/tomcat-users.xml" \<br> "$CATALINA_BASE/logs" "$CATALINA_BASE/temp" \<br> "$CATALINA_BASE/webapps" "$CATALINA_BASE/work" \<br> "$CATALINA_BASE/logs/catalina.out" || true<br><br> # Look for rotatelogs/rotatelogs2<br> if [ -x /usr/sbin/rotatelogs ]; then<br> ROTATELOGS=/usr/sbin/rotatelogs<br> else<br>
ROTATELOGS=/usr/sbin/rotatelogs2<br> fi<br><br> # -p preserves the environment (for $JAVA_HOME etc.)<br> # -s is required because tomcat5's login shell is /bin/false<br> su -p -s /bin/sh $TOMCAT5_USER \<br> -c "$ROTATELOGS \"$CATALINA_BASE/logs/catalina_%F.log\" 86400" \<br> < "$CATALINA_BASE/logs/catalina.out" &<br> su -p -s /bin/sh $TOMCAT5_USER \<br>
-c "\"$DAEMON\" start $STARTUP_OPTS" \<br> >> "$CATALINA_BASE/logs/catalina.out" 2>&1<br> echo "$NAME."<br> else<br> echo "(already running)."<br> fi<br> ;;<br> stop)<br> echo -n "Stopping $DESC: "<br> if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \<br> --user "$TOMCAT5_USER" --startas "$JAVA_HOME/bin/java" \<br> >/dev/null; then<br> echo "(not
running)."<br> else<br> su -p -s /bin/sh $TOMCAT5_USER -c "\"$DAEMON\" stop" \<br> >/dev/null 2>&1 || true<br> # Fallback to kill the JVM process in case stopping didn't work<br> sleep 1<br> while ! start-stop-daemon --test --start \<br> --pidfile "$CATALINA_PID" --user "$TOMCAT5_USER" \<br> --startas "$JAVA_HOME/bin/java" >/dev/null; do<br> sleep 1<br>
echo -n "."<br> TOMCAT5_SHUTDOWN=`expr $TOMCAT5_SHUTDOWN - 1` || true<br> if [ $TOMCAT5_SHUTDOWN -le 0 ]; then<br> echo -n " (killing) "<br> start-stop-daemon --stop --signal 9 --oknodo \<br> --quiet --pidfile "$CATALINA_PID" \<br> --user
"$TOMCAT5_USER"<br> fi<br> done<br> rm -f "$CATALINA_PID" "$CATALINA_BASE/logs/catalina.out"<br> echo "$NAME."<br> fi<br> ;;<br> status)<br> if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \<br> --user $TOMCAT5_USER --startas "$JAVA_HOME/bin/java" \<br> >/dev/null; then<br><br> if [ -f "$CATALINA_PID" ]; then<br> echo "$DESC is not running, but pid file
exists."<br> exit 1<br> else<br> echo "$DESC is not running."<br> exit 3<br> fi<br> else<br> echo -n "$DESC is running with Java pid "<br> cat "$CATALINA_PID"<br> exit 0<br> fi<br> ;;<br> reload)<br> echo "Reload is not implemented!" >&2<br> exit 3<br> ;;<br>
restart|force-reload)<br> $0 stop<br> sleep 1<br> $0 start<br> ;;<br> *)<br> echo "Usage: /etc/init.d/tomcat5 {start|stop|restart|force-reload|status}<wbr>" >&2<br> exit 2<br> ;;<br>esac<br><br>exit 0<br>----------------------------------------<wbr>----------<wbr>----------<wbr>----------<wbr>----------<wbr>----------<br><br>thanks n regs<br><br>jags</div><p>
<hr size=1>Get your own <a href=" http://us.rd.yahoo.com/evt=43290/*http://smallbusiness.yahoo.com/domains"
>web address for just $1.99/1st yr</a>. We'll help. <a href="http://us.rd.yahoo.com/evt=41244/*http://smallbusiness.yahoo.com/"
>Yahoo! Small Business</a>.