> 
> From: Warren Pace <[EMAIL PROTECTED]>
> Date: 2006/02/23 Thu PM 06:43:49 EST
> To: "Tomcat Users List" <users@tomcat.apache.org>
> Subject: Re: Tomcat5.5 init script on FC4 revisited
> 
> 
> > 
> > From: Bob Hartung <[EMAIL PROTECTED]>
> > Date: 2006/02/22 Wed PM 05:35:05 EST
> > To: TomcatUsers <users@tomcat.apache.org>
> > Subject: Tomcat5.5 init script on FC4 revisited
> > 
> > Hi all,
> >    I have modified a file from Warren Pace.  After running, I can ps ax 
> > | grep jsvc and have two pids but trying to http://localhost:8080 gives 
> > a refusal.  I have checked the log files and there is no entry.  If I 
> > try to start with the startup.sh file everygthing works including 
> > running the shell script as either root or user tomcat.  I have 
> > reproduced portions of the file below.  This file is written for SuSE 
> > and I am running FC4.  I do not find checkproc on the fedora site.
> > 
> >    Any and all suggestions appreciated.
> Bob,
>      You "should" have a script in /etc/init.d named skeleton which will 
> serve as a template.  I believe checkproc is part of the kernel.  Make sure 
> the jsvc executable has been copied from $CATALINA_HOME/bin/jsvc-src to 
> $CATALINA_HOME/bin.  If you've attempted to start tomcat using jsvc and get a 
> "refused" message when attempting to connect to http://localhost:8080 but 
> then run startup.sh and can connect to http://localhost:8080 then I don't 
> believe jsvc ever launched.
> warren
> > 
Bob,
     I just had another thought.  If you've never written your own init script 
before, you might not know.  You also have to create start and stop symlinks to 
the script (which should be saved in /etc/init.d) in the rcX.d folders for the 
appropriate runlevels.  For instance, in my script the default runlevels are 
noted 3 and 5.  Get a directory listing of /etc/init.d/rc3.d and see where 
network is starting and create a symlink to jsvc which calls it to launch after 
network and another which calls it to stop before network. 
create a start symlink by typing:
ln -s ./tomcat5 S13tomcat5 (make sure to include the . before the /) 
a kill symlink by typing:
ln -s ./tomcat5 K09tomcat5
just make sure the start Sxx is higher than network's and the kill Kxx is 
lower.  Do the same in rc5.d.
I've used FC4 only sparingly but I'm sure there's a an equivalent to YaST for 
configuration of your system where you can do all this from the desktop...
> > ---------------- begin file -----------------------
> > #!/bin/sh
> > # Copyright (c) 2005 Warren Pace, Charleston, SC, USA
> > # init.d script for Apache-Tomcat ver 5.5.12
> > # For Open SuSE Linux ver 10.0
> > # Free for all - Use at your own risk
> > # Author:  Warren Pace <[EMAIL PROTECTED]>
> > #
> > # /etc/init.d/tomcat5
> > #
> > 
> > 
> > JAVA_HOME=/usr/local/java
> > CATALINA_HOME=/usr/local/tomcat5
> > DAEMON_HOME=/usr/local/tomcat5
> > TOMCAT_USER=tomcat
> > 
> > TMP_DIR=/var/tmp
> > PID_FILE=/var/run/jsvc.pid
> > CATALINA_BASE=/usr/local/tomcat5
> > CATALINA_TMPDIR=/usr/local/tomcat5/temp
> > CATALINA_OPTS="-Djava.endorsed.dirs=$CATALINA_HOME/common/endorsed"
> > CLASSPATH=\
> > $JAVA_HOME/lib/tools.jar:\
> > $CATALINA_HOME/bin/commons-daemon.jar:\
> > $CATALINA_HOME/bin/bootstrap.jar
> > 
> > JSVC_BIN=$DAEMON_HOME/bin/jsvc
> > 
> > #. /etc/rc.status
> > #rc_reset
> > 
> > if [ ! -x ${JSVC_BIN} ]; then
> >     echo -n >$2 "Cannot Run Tomcat as a jsvc daemon, ${JSVC_BIN} is not
> > installed. "
> > #   rc_status -s
> >     exit 5
> > fi
> > 
> > case "$1" in
> >     start)
> >             #
> >     # Start Tomcat
> >             #
> >             echo -n "Starting Tomcat 5.5.12 Servlet Engine "
> > #       checkproc on installed on FC4 (?)
> > #           checkproc -p ${PID_FILE} ${JSVC_BIN}
> > #           case $? in
> > #           0) echo -n "- Warning: daemon already running. " ;;
> > #           1) echo -n "- Warning: ${PID_FILE} exists. " ;;
> > #           esac
> >             $DAEMON_HOME/bin/jsvc \
> >             -user $TOMCAT_USER \
> >             -home $JAVA_HOME \
> >             -Dcatalina.home=$CATALINA_HOME \
> >             -Dcatalina.base=$CATALINA_BASE \
> >             -Dcatalina.tmpdir=$CATALINA_TMPDIR \
> >             -Djava.io.tmpdir=$TMP_DIR \
> >             -wait 10 \
> >             -pidfile $PID_FILE \
> >             -outfile $CATALINA_HOME/logs/catalina.out \
> >             -errfile '&1' \
> >             $CATALINA_OPTS \
> >     -Xms64M -Xmx128M \
> >             -cp $CLASSPATH \
> >             org.apache.catalina.startup.Bootstrap \
> >             #-verbose \
> >             #-debug \
> >             chown -R -H --dereference tomcat:tomcat $CATALINA_HOME/*
> >             chown -R -H --dereference tomcat:tomcat $CATALINA_BASE/*
> > #           rc_status -v
> >             ;;
> > 
> > ---------------------------------------------------------------------
> > 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]

Reply via email to