Hello Warren,

actually I don't do more than invoking the tarball provided
catalina.sh script
where to my knowledge classpaths and similar env stuff is set
mainly in accordance
to a set JAVA_HOME.
I didn't touch catalina.sh, nor startup.sh.
I merely wrapped my own wee scriplet around that so that
heartbeat can start and stop 
the thing.
All the noise up to the case block in line 55 is just some weird
check for available resources.



$ cat -n /etc/ha.d/resource.d/catalina
      1 #!/bin/bash
      2 #
      3 # catalina - Heartbeat resource start/stop wrapper for
Catalina server
      4 #
      5 # should be placed in /etc/ha.d/resource.d/ and
distributed to failover node
      6 #
      7 # ITDZ PB22Gr 20060202
      8 
      9 RUNAS=tomcat
     10 JAVA_HOME=/usr/java/jre1.5.0_06 
     11 CATALINA_HOME=/var/www/tomcat/5.5.15
     12 export JAVA_HOME CATALINA_HOME
     13 
     14 request=${1:-version}; shift
     15 
     16 declare -i rc=0 lvs_on=0
     17 
     18 if [ ! -x $JAVA_HOME/bin/java ]; then
     19     rc=1
     20     echo "Cannot find Java interpreter, please adjust
JAVA_HOME in $0"
     21     exit $rc
     22 fi >&2
     23 
     24 if [ ! -d $CATALINA_HOME ]; then
     25     if /sbin/drbdadm state r0|cut -d/ -f1|grep -qi
primary; then
     26         declare -a ha_vgs=($(grep ^[^#]
/etc/ha.d/haresources |awk -F"::" '/LVM/{print$NF}'|tr -cd
'[[:alnum:]]'))
     27         for vg in ${ha_vgs[*]}; do
     28             lvs_on=$(/usr/sbin/vgdisplay -c vgshare|cut
-d: -f7)
     29             if (( ! $lvs_on )); then
     30                 rc=1
     31                 echo "Heartbeat resource $vg has no LVs
open" >&2
     32                 continue
     33             fi
     34         done
     35         if ! df -P|grep -q $(dirname $CATALINA_HOME);
then
     36             echo "Either CATALINA_HOME set to wrong path
in $0, or heartbeat couldn't mount $CATALINA_HOME"
     37             echo "Check /var/log/ha.log"
     38             rc=1
     39         fi >&2
     40     else
     41         echo "DRBD not in primary mode on this node" >&2
     42         rc=1
     43     fi
     44     (( $rc )) || exit $rc
     45 fi
     46 
     47 wrapper=$CATALINA_HOME/bin/catalina.sh
     48 
     49 if [ ! -x $wrapper ]; then
     50     rc=1
     51     echo "Didn't find executable $wrapper" >&2
     52     exit $rc
     53 fi
     54 
     55 case $request in
     56     start)
     57         #$wrapper $request "$@"
     58         su $RUNAS -c $wrapper\ $request\ "$@"
     59         rc=$?
     60         ;;
     61     stop)
     62         su $RUNAS -c $wrapper\ stop
     63         rc=$?
     64         ;;
     65     version)
     66         $wrapper $request
     67         rc=$?
     68         ;;
     69     *)
     70         cat <<-USAGE>&2
     71         usage: $(basename $0) { start | stop | version }
[ catalina_arglist ]
     72 USAGE
     73 ;;
     74 esac
     75 
     76 exit $rc



This script is usually invoked by heartbeat (if not manually for
testing or maintenance).
Heartbeat passes it the -security switch as argument (along with
the implicit either start or stop)

$ grep catalina /etc/ha.d/haresources 
    catalina::-security


> -----Original Message-----
> From: Warren Pace [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 06, 2006 10:50 PM
> To: Tomcat Users List
> Subject: Re: Tomcat Startup Messages
> 
> 
> 
> > 
> > From: <[EMAIL PROTECTED]>
> > Date: 2006/02/06 Mon AM 11:17:08 EST
> > To: <users@tomcat.apache.org>
> > Subject: Tomcat Startup Messages
> > 
> > Hello,
> > 
> > although I didn't find an answer whether to have catalina run
as
> > root proc or under unprivileged uid
> > (Charles Cladarale mentioned it was required for binding to
low
> > ports, for which there's no need in my setup since I so far
used
> > standard ports which are all well beyond 1023)
> > I decided for the latter.
> > So I eventually did a 
> > chown -R tomcat:apache $CATALINA_HOME
> > and restarted the thing with su to tomcat, and with the
-security
> > switch set
> > (albeit with the standard catalina.policy as it came out of
the
> > tarball so far)
> > 
> > In the catalina.out I stumbled over these entries.
> > 
> Ralph,
>      How are you starting Tomcat?  Are you using startup.sh 
> or catalina.sh?  Did you happen to edit either of these 
> files?  Sounds as if classpath has been changed.  
> warren
> > 
> > Feb 6, 2006 4:55:17 PM
> > org.apache.catalina.core.AprLifecycleListener lifecycleEvent
> > INFO: The Apache Tomcat Native library which allows optimal
> > performance in production environments was not found on the
> > java.library.path:
> >
/usr/java/jre1.5.0_06/lib/i386/client:/usr/java/jre1.5.0_06/lib/i
> > 386:/usr/java/jre1.5.0_06/../lib/i386
> > 
> > 
> > Is it worthwhile installing the Apache Tomcat Native Lib, and
> > where would I get it
> > (probably somewhere beneath tomcat.apache.org)?
> > 
> > I don't intend to install a JDK on this box (where the NatLib
is
> > probably shipped with?)
> > since this shouldn't be a development box.
> > 
> > 
> > Feb 6, 2006 4:55:17 PM org.apache.catalina.core.StandardHost
> > start
> > INFO: XML validation disabled
> > 
> > Does it mean it would run a pre-flight check for non valid
XML in
> > config files?
> > What would it take to enable XML validation?
> > 
> > And finally, what about these errors marked severe?
> > 
> > Feb 6, 2006 4:55:18 PM
org.apache.catalina.core.StandardContext
> > start
> > SEVERE: Error filterStart
> > 
> > Where would I have to setup filters?
> > What filters?
> > Kind of TCP wrapper, or ACLs?
> > 
> > 
> > Feb 6, 2006 4:55:18 PM
org.apache.catalina.core.StandardContext
> > start
> > SEVERE: Context [/balancer] startup failed due to previous
errors
> > Feb 6, 2006 4:55:19 PM
> > org.apache.coyote.http11.Http11BaseProtocol start
> > 
> > Right, I haven't yet set up a load balancer.
> > But I guess this is optional stuff, isn't it?
> > 
> > 
> > However, tomcat seems to have started
> > 
> > # ps -fu tomcat
> > UID        PID  PPID  C STIME TTY          TIME CMD
> > tomcat   22682     1  4 16:55 pts/1    00:00:02
> > /usr/java/jre1.5.0_06/bin/java -Djava.util.logging.ma
> > 
> > 
> > as a wget of the /manager/list URL shows
> > 
> > 
> > OK - Listed applications for virtual host localhost
> > /webdav:running:0:webdav
> > /servlets-examples:running:0:servlets-examples
> > /jsp-examples:running:0:jsp-examples
> > /balancer:stopped:0:balancer
> >
/host-manager:running:0:/var/www/tomcat/apache-tomcat-5.5.15/serv
> > er/webapps/host-manager
> > /tomcat-docs:running:0:tomcat-docs
> > /:running:0:ROOT
> >
/manager:running:0:/var/www/tomcat/apache-tomcat-5.5.15/server/we
> > bapps/manager
> > 
> > 
> > 
> > 
> > 
> > 
>
-----------------------------------------------------------------
----
> > 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