On Sun, 2009-02-01 at 08:20 +0000, Dave Pawson wrote:
> Fedora 10, Tomcat 6
> 
> Looking to set up a startup/shutdown script
> based on
> http://www.mythic-beasts.com/support/tomcat-initscript
> with paths corrected.
> 
> Adding debug I'm seeing, in the logs
> 
> INFO: Jk running ID=0 time=0/27  config=null
> Feb 1, 2009 7:18:44 AM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 929 ms
> 01/02/2009 07:23:58 5575 jsvc.exec error: Cannot open PID file
> /var/run/jsvc.pid, PID is 5575
> 01/02/2009 07:23:58 5574 jsvc.exec error: Service exit with a return
> value of 255
> 
> I.e. the PID isn't being written to /var/run/jsvc.pid
> 
> Any suggestions please?
> 

Well, I use the jsvc daemon to start my tomcat on fedora 10.  Tomcat 6

your mileage will vary, but here is my start stript.  I also use the apr
native libs hence the -Djava.library.path=/usr/local/apr/lib and I've
also setup monitoring 


#!/bin/sh
#
# chkconfig: 345 86 15
# description: Tomcat Server
#
# Small shell script to show how to start/stop Tomcat using jsvc
# If you want to have Tomcat running on port 80 please modify the
server.xml
# file:
#
#    <!-- Define a non-SSL HTTP/1.1 Connector on port 80 -->
#    <Connector
className="org.apache.catalina.connector.http.HttpConnector"
#               port="80" minProcessors="5" maxProcessors="75"
#               enableLookups="true" redirectPort="8443"
#               acceptCount="10" debug="0" connectionTimeout="60000"/>
#
# You need a developement version of Tomcat (Apache Tomcat/4.1-dev)
#
# Adapt the following lines to your configuration
JAVA_HOME=/usr/jdk
CATALINA_HOME=/opt/tomcat
CATALINA_BASE=/opt/webBaseDir
DAEMON_HOME=/usr/local/bin
TOMCAT_USER=tomcat
TMP_DIR=$CATALINA_BASE/temp
CATALINA_OPTS=" -Djava.library.path=/usr/local/apr/lib
 -Djava.awt.headless=true
 -Xms128M -Xmx512M
 -XX:+UseParallelOldGC
 -Dcom.sun.management.jmxremote
 -Dcom.sun.management.jmxremote.port=9086
 -Dcom.sun.management.jmxremote.ssl=false
 -Dcom.sun.management.jmxremote.authenticate=false
"
CLASSPATH=\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/tomcat-juli.jar:\
$CATALINA_HOME/bin/bootstrap.jar

case "$1" in
  start)
    #
    # Start Tomcat
    #
    $DAEMON_HOME/jsvc \
    -user $TOMCAT_USER \
    -home $JAVA_HOME \
    -jvm server \
    -Dcatalina.home=$CATALINA_HOME \
    -Dcatalina.base=$CATALINA_BASE \
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
    -Djava.util.logging.config.file=
$CATALINA_BASE/conf/logging.properties \
    -Djava.endorsed.dirs=$CATALINA_BASE/endorsed \
    -Djava.io.tmpdir=$TMP_DIR \
    -outfile $CATALINA_BASE/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 \
    ;;

  stop)
    #
    # Stop Tomcat
    #
    PID=`cat /var/run/jsvc.pid`
    kill $PID
    ;;

  *)
    echo "Usage tomcat.sh start/stop"
    exit 1
    ;;
esac


-- 
Brian Millett - [ Londo and Sinclair, "A Voice in the Wilderness I"]
"If the Narns all stood together in one place and hated all at the same
    time, that hatred could fly across dozens of light years and reduce
    Centauri Prime to a ball of ash. That's how much they hate *us*."
'You don't have to respond in kind.'
"Of course we do. It is a natural law. Physics tells us that for every
    action, there must be an equal and opposite reaction. They hate us,
    we hate them, they hate us back and so, here we are, victims of
    mathematics."

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to