RE: tomcat caching jsp to working directory (not /work)
What happens if you start tomcat using $CATALINA_HOME/bin/startup.sh instead? I think that should point tomcat to the right work directory. -Original Message- From: Euan Guttridge [mailto:[EMAIL PROTECTED] Sent: October 24, 2003 4:57 AM To: '[EMAIL PROTECTED]' Subject: tomcat caching jsp to working directory (not /work) When I start tomcat as root using /etc/init.d/tomcat start, which in turn starts $CATALINA_HOME/bin/startup.sh as tomcat, tomcat attempts to cache all jsps to the directory from which I ran /etc/init.d/tomcat start.. I can force jsps to cache to $CATALINA_HOME/work/... by setting SCRATCHDIR in $CATALINA_HOME/conf/web.xml but this is a workaround not a resolution. Any ideas? Thanks Euan _ From : /etc/init.d/tomcat #!/bin/bash # # chkconfig: # description: Startup script for Tomcat # Source function lib . /etc/init.d/functions RETVAL=$? case $1 in start) if [ -f $CATALINA_HOME/bin/startup.sh ]; then echo $Starting Tomcat /bin/su tomcat $CATALINA_HOME/bin/startup.sh fi ;; stop) if [ -f $CATALINA_HOME/bin/shutdown.sh ]; then echo $Stopping Tomcat /bin/su tomcat $CATALINA_HOME/bin/shutdown.sh fi ;; *) echo $Usage: $0 {start|stop} exit 1 ;; esac exit $RETVAL __ From : $CATALINA_HOME/bin/startup.sh #!/bin/sh # - # Start Script for the CATALINA Server # # $Id: startup.sh,v 1.2 2002/01/15 02:55:38 patrickl Exp $ # - # resolve links - $0 may be a softlink PRG=$0 while [ -h $PRG ] ; do ls=`ls -ld $PRG` link=`expr $ls : '.*- \(.*\)$'` if expr $link : '.*/.*' /dev/null; then PRG=$link else PRG=`dirname $PRG`/$link fi done PRGDIR=`dirname $PRG` EXECUTABLE=catalina.sh # Check that target executable exists if [ ! -x $PRGDIR/$EXECUTABLE ]; then echo Cannot find $PRGDIR/$EXECUTABLE echo This file is needed to run this program exit 1 fi exec $PRGDIR/$EXECUTABLE start $@ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat caching jsp to working directory (not /work)
Essentially that is exactly what I am doing - the /etc/init.d/tomcat script just fires up $CATALINA_HOME/bin/startup.sh as tomcat user. Thanks Euan -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: 24 October 2003 17:52 To: 'Tomcat Users List' Subject: RE: tomcat caching jsp to working directory (not /work) What happens if you start tomcat using $CATALINA_HOME/bin/startup.sh instead? I think that should point tomcat to the right work directory. -Original Message- From: Euan Guttridge [mailto:[EMAIL PROTECTED] Sent: October 24, 2003 4:57 AM To: '[EMAIL PROTECTED]' Subject: tomcat caching jsp to working directory (not /work) When I start tomcat as root using /etc/init.d/tomcat start, which in turn starts $CATALINA_HOME/bin/startup.sh as tomcat, tomcat attempts to cache all jsps to the directory from which I ran /etc/init.d/tomcat start.. I can force jsps to cache to $CATALINA_HOME/work/... by setting SCRATCHDIR in $CATALINA_HOME/conf/web.xml but this is a workaround not a resolution. Any ideas? Thanks Euan _ From : /etc/init.d/tomcat #!/bin/bash # # chkconfig: # description: Startup script for Tomcat # Source function lib . /etc/init.d/functions RETVAL=$? case $1 in start) if [ -f $CATALINA_HOME/bin/startup.sh ]; then echo $Starting Tomcat /bin/su tomcat $CATALINA_HOME/bin/startup.sh fi ;; stop) if [ -f $CATALINA_HOME/bin/shutdown.sh ]; then echo $Stopping Tomcat /bin/su tomcat $CATALINA_HOME/bin/shutdown.sh fi ;; *) echo $Usage: $0 {start|stop} exit 1 ;; esac exit $RETVAL __ From : $CATALINA_HOME/bin/startup.sh #!/bin/sh # - # Start Script for the CATALINA Server # # $Id: startup.sh,v 1.2 2002/01/15 02:55:38 patrickl Exp $ # - # resolve links - $0 may be a softlink PRG=$0 while [ -h $PRG ] ; do ls=`ls -ld $PRG` link=`expr $ls : '.*- \(.*\)$'` if expr $link : '.*/.*' /dev/null; then PRG=$link else PRG=`dirname $PRG`/$link fi done PRGDIR=`dirname $PRG` EXECUTABLE=catalina.sh # Check that target executable exists if [ ! -x $PRGDIR/$EXECUTABLE ]; then echo Cannot find $PRGDIR/$EXECUTABLE echo This file is needed to run this program exit 1 fi exec $PRGDIR/$EXECUTABLE start $@ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat caching jsp to working directory (not /work)
Um, I think there is a difference. Something to do with the way tomcat resolves its relative path. In my .bashrc file, I had to cd to $CATALINA_HOME/bin/startup.sh first before start tomcat. Otherwise I would get a problme similar to yours. Try it and see what happens... alias startTomcat='cd $CATALINA_HOME/bin; ./startup.sh; cd -;' alias stopTomcat=' $CATALINA_HOME/bin/shutdown.sh' -Yan -Original Message- From: Euan Guttridge [mailto:[EMAIL PROTECTED] Sent: October 24, 2003 11:05 AM To: 'Tomcat Users List' Subject: RE: tomcat caching jsp to working directory (not /work) Essentially that is exactly what I am doing - the /etc/init.d/tomcat script just fires up $CATALINA_HOME/bin/startup.sh as tomcat user. Thanks Euan -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: 24 October 2003 17:52 To: 'Tomcat Users List' Subject: RE: tomcat caching jsp to working directory (not /work) What happens if you start tomcat using $CATALINA_HOME/bin/startup.sh instead? I think that should point tomcat to the right work directory. -Original Message- From: Euan Guttridge [mailto:[EMAIL PROTECTED] Sent: October 24, 2003 4:57 AM To: '[EMAIL PROTECTED]' Subject: tomcat caching jsp to working directory (not /work) When I start tomcat as root using /etc/init.d/tomcat start, which in turn starts $CATALINA_HOME/bin/startup.sh as tomcat, tomcat attempts to cache all jsps to the directory from which I ran /etc/init.d/tomcat start.. I can force jsps to cache to $CATALINA_HOME/work/... by setting SCRATCHDIR in $CATALINA_HOME/conf/web.xml but this is a workaround not a resolution. Any ideas? Thanks Euan _ From : /etc/init.d/tomcat #!/bin/bash # # chkconfig: # description: Startup script for Tomcat # Source function lib . /etc/init.d/functions RETVAL=$? case $1 in start) if [ -f $CATALINA_HOME/bin/startup.sh ]; then echo $Starting Tomcat /bin/su tomcat $CATALINA_HOME/bin/startup.sh fi ;; stop) if [ -f $CATALINA_HOME/bin/shutdown.sh ]; then echo $Stopping Tomcat /bin/su tomcat $CATALINA_HOME/bin/shutdown.sh fi ;; *) echo $Usage: $0 {start|stop} exit 1 ;; esac exit $RETVAL __ From : $CATALINA_HOME/bin/startup.sh #!/bin/sh # - # Start Script for the CATALINA Server # # $Id: startup.sh,v 1.2 2002/01/15 02:55:38 patrickl Exp $ # - # resolve links - $0 may be a softlink PRG=$0 while [ -h $PRG ] ; do ls=`ls -ld $PRG` link=`expr $ls : '.*- \(.*\)$'` if expr $link : '.*/.*' /dev/null; then PRG=$link else PRG=`dirname $PRG`/$link fi done PRGDIR=`dirname $PRG` EXECUTABLE=catalina.sh # Check that target executable exists if [ ! -x $PRGDIR/$EXECUTABLE ]; then echo Cannot find $PRGDIR/$EXECUTABLE echo This file is needed to run this program exit 1 fi exec $PRGDIR/$EXECUTABLE start $@ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]