Caldarale, Charles R escreveu:

First of all, thanks for your reply

Make sure you remove Tomcat's 1.4 compatibility package before attempting to 
run it on Jave SE 5 or 6.
I guess i can find some info online about how to do it, but should i just remove it or upgrade it?
I atached the script hoping that someone can take a look and tell-me wath to change...

Attachments are often stripped off before reaching the list - including this 
time.

 - Chuck
I guess this time i forgot the atchment O:-) , this time i'll send it...

Thank's once again

Hernâni
#!/bin/sh
#
# Startup script for Tomcat 5.0, the Apache Servlet Engine
#
# chkconfig: - 80 20
# description: Tomcat 5.0 is the Apache Servlet Engine RI for Servlet 2.4/JSP 
2.0
# processname: tomcat
# pidfile: /var/run/tomcat5.pid
# config:  /etc/tomcat5/tomcat5.conf
#
# Gomez Henri <[EMAIL PROTECTED]>
# Keith Irwin <[EMAIL PROTECTED]>
# Nicolas Mailhot <[EMAIL PROTECTED]>
#
# version 1.02 - Removed initlog support
# version 1.03 - Removed config:
# version 1.04 - tomcat will start before httpd and stop after httpd
# version 1.05 - jdk hardcoded to link /usr/java/jdk and tomcat runs as "nobody"
# version 1.06 - split up into script and config file
# version 1.07 - Rework from Nicolas ideas
# version 1.08 - Fix work dir permission at start time, switch to use tomcat4
# version 1.09 - Fix pidfile and config tags
# version 1.10 - Fallback to su direct use on systems without Redhat/Mandrake 
init.d functions
# version 1.11 - Fix webapps dir permissions
# version 1.12 - remove initial start/stop level for chkconfig (- 80 20)
# version 1.13 - remove chown of logs/work/temp/webapps dir, owned by tomcat4 
at install time
# version 1.14 - correct the start/stop ugly hack by waiting all the threads 
stops
# version 1.15 - ensure we're looking for TOMCAT_USER running catalina
# version 1.16 - Add support for CATALINA_PID env var
# version 1.17 - Remove run files only tomcat started correctl
#                in start area, check that tomcat is not allready running
# version 1.18 - Fix kill typo (thanks Kaj J. Niemi)
# version 1.19 - Add jar relinking
# version 1.20 - Check there is no stalling tomcat4.pid
# version 1.20tc5 - Changed all instances of tomcat4 to tomcat5 except 
TOMCAT_USER
# version 1.21 - Add status command
#

# Source function library.
if [ -x /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi

# Get Tomcat config

TOMCAT_CFG="/etc/tomcat5/tomcat5.conf"

[ -r "$TOMCAT_CFG" ] && . "${TOMCAT_CFG}"

# Path to the tomcat launch script (direct don't use wrapper)
TOMCAT_SCRIPT=/usr/bin/dtomcat5

# Path to the script that will refresh jar symlinks on startup
TOMCAT_RELINK_SCRIPT="/usr/share/tomcat5/bin/relink"

# Tomcat name :)
TOMCAT_PROG=tomcat5
        
# if TOMCAT_USER is not set, use tomcat5 like Apache HTTP server
if [ -z "$TOMCAT_USER" ]; then
    TOMCAT_USER="tomcat4"
fi

# Since the daemon function will sandbox $tomcat
# no environment stuff should be defined here anymore.
# Please use the /etc/tomcat.conf file instead ; it will
# be read by the $tomcat script

RETVAL=0

# See how we were called.
start() {
    echo -n "Starting $TOMCAT_PROG: "

        if [ -f /var/lock/subsys/tomcat5 ] ; then
                if [ -f /var/run/tomcat5.pid ]; then
                        read kpid < /var/run/tomcat5.pid
                        if checkpid $kpid 2>&1; then
                                echo "process allready running"
                                return -1
                        else
                                echo "lock file found but no process running 
for pid $kpid, continuing"
                        fi
                fi
        fi
 
        export CATALINA_PID=/var/run/tomcat5.pid
        touch $CATALINA_PID
        chown $TOMCAT_USER:$TOMCAT_USER $CATALINA_PID

        $TOMCAT_RELINK_SCRIPT

        if [ -x /etc/rc.d/init.d/functions ]; then
                daemon --user $TOMCAT_USER $TOMCAT_SCRIPT start 
        else
                su - $TOMCAT_USER -c "$TOMCAT_SCRIPT start"
        fi

        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/tomcat5
        return $RETVAL
}

stop() {
    echo -n "Stopping $TOMCAT_PROG: "

    if [ -f /var/lock/subsys/tomcat5 ] ; then
      if [ -x /etc/rc.d/init.d/functions ]; then
          daemon --user $TOMCAT_USER $TOMCAT_SCRIPT stop
      else
          su - $TOMCAT_USER -c "$TOMCAT_SCRIPT stop"
      fi
      RETVAL=$?

      if [ $RETVAL = 0 ]; then
        count=0;

        if [ -f /var/run/tomcat5.pid ]; then

            read kpid < /var/run/tomcat5.pid
            let kwait=$SHUTDOWN_WAIT

            until [ `ps --pid $kpid | grep -c $kpid` = '0' ] || [ $count -gt 
$kwait ]
            do
                echo "waiting for processes to exit";
                sleep 1
                let count=$count+1;
            done

            if [ $count -gt $kwait ]; then
                echo "killing processes which didn't stop after $SHUTDOWN_WAIT 
seconds"
                kill -9 $kpid
            fi
        fi
    
                rm -f /var/lock/subsys/tomcat5 /var/run/tomcat5.pid
    fi

    fi
}

status() {
        if [ -f /var/lock/subsys/tomcat5 ] ; then
                if [ -f /var/run/tomcat5.pid ]; then
                        read kpid < /var/run/tomcat5.pid
                        if checkpid $kpid 2>&1; then
                                echo "tomcat5 is running ($kpid)"
                        else
                                echo "lock file found but no process running 
for pid $kpid"
                        fi
                        return 0
                fi
        fi
        echo "tomcat5 is stopped."
}


# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status
        ;;
  restart)
        stop
        sleep 2 
        start
        ;;
  condrestart)
        if [ -f /var/run/tomcat5.pid ] ; then
                stop
                start
        fi
        ;;
  *)
        echo "Usage: $TOMCAT_PROG {start|stop|status|restart|condrestart}"
        exit 1
esac

exit $RETVAL

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to