[lug] tomcat5.5 as daemon on FC4

D. Stimits stimits at comcast.net
Fri Nov 25 17:19:54 MST 2005


...
> I just downloaded the 5.5.12, untarred it to /var/tmp, cd
> /var/tmp/apache-tomcat-5.5.12/bin, untarred jsvc.tar.gz, cd jsvc-src,
> chmod 700 configure,  ./configure --with-java=/usr/java/jdk1.5.0_05, make,
> cp jsvc binary to $CATALINA_HOME/bin, edit Tomcat5.sh, chmod 700
> Tomcat5.sh
> 
> and then ./Tomcat5.sh and it started.

I'm going to try this script out sometime tonight or tomorrow, I'm a bit 
too wiped out from migraines at the moment (not a full migraine, but 
enough to ruin my last few days).

Incidentally, the reason I really wanted to use jsvc is to use the 
change-to-other-user option after startup. I believe redhat scripts also 
have ways of doing this, but perhaps those ways can break something in 
tomcat5. Does anyone here know what the difference is between just 
starting tomcat directly, versus starting it with jsvc...other than 
being able to change the effective user after startup? The jsvc program 
seems to be more than just a wrapper, I'm not sure what all it does.

D. Stimits, stimits AT comcast DOT net

> contents of Tomcat5.sh (not including most comments):
> 
> JAVA_HOME=/usr/java/jdk1.5.0_05
> CATALINA_HOME=/var/tmp/apache-tomcat-5.5.12
> DAEMON_HOME=/var/tmp/apache-tomcat-5.5.12/bin
> TOMCAT_USER=hugh
> 
> # for multi instances adapt those lines.
> TMP_DIR=/var/tmp
> PID_FILE=/var/tmp/jsvc.pid
> CATALINA_BASE=$CATALINA_HOME
> 
> CATALINA_OPTS=""
> CLASSPATH=\
> $JAVA_HOME/lib/tools.jar:\
> $CATALINA_HOME/bin/commons-daemon.jar:\
> $CATALINA_HOME/bin/bootstrap.jar
> 
> case "$1" in
>   start)
>     #
>     # Start Tomcat
>     #
>     $DAEMON_HOME/jsvc \
>     -user $TOMCAT_USER \
>     -home $JAVA_HOME \
>     -Dcatalina.home=$CATALINA_HOME \
>     -Dcatalina.base=$CATALINA_BASE \
>     -Djava.io.tmpdir=$TMP_DIR \
>     -wait 10 \
>     -pidfile $PID_FILE \
>     -outfile $CATALINA_HOME/logs/catalina.out \
>     -errfile '&1' \
>     $CATALINA_OPTS \
>     -cp $CLASSPATH \
>     org.apache.catalina.startup.Bootstrap
>     #
>     # To get a verbose JVM
>     #-verbose \
>     # To get a debug of jsvc.
>     #-debug \
>     exit $?
>     ;;
> 
>   stop)
>     #
>     # Stop Tomcat
>     #
>     $DAEMON_HOME/jsvc \
>     -stop \
>     -pidfile $PID_FILE \
>     org.apache.catalina.startup.Bootstrap
>     exit $?
>     ;;
> 
>   *)
>     echo "Usage tomcat.sh start/stop"
>     exit 1;;
> esac
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
> 




More information about the LUG mailing list