tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Lucia" <timlu...@yahoo.com>
Subject RE: Tomcat as a deoman
Date Thu, 17 May 2007 11:27:58 GMT
Here is /etc/init.d/tomcat from a RHEL4 system:

#!/bin/bash
#
# tomcat
#
# description:  Start up the Tomcat servlet engine.
#
# Source function library.
. /etc/init.d/functions

RETVAL=$?
export JAVA_HOME="/usr/java"
CATALINA_HOME="/usr/local/tomcat"

case "$1" in
 start)
        if [ -f $CATALINA_HOME/bin/startup.sh ];
          then
            echo $"Starting Tomcat"
            ulimit -n 8192 && echo "open files set to `ulimit -n`"
            JAVA_OPTS="-Xmx4096m" $CATALINA_HOME/bin/startup.sh
        fi
        ;;
 stop)
        if [ -f $CATALINA_HOME/bin/shutdown.sh ];
          then
            echo $"Stopping Tomcat"
            $CATALINA_HOME/bin/shutdown.sh
        fi
        ;;
 restart)
        $0 stop
        $0 start
        ;;
 *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac

exit $RETVAL

Tim


> -----Original Message-----
> From: David Smith [mailto:dns4@cornell.edu]
> Sent: Thursday, May 17, 2007 7:04 AM
> To: Tomcat Users List
> Subject: Re: Tomcat as a deoman
> 
> Easy --
> 
> 1. Download tomcat 5.0 and install.  Get it working usng the standard
> start/stop scripts.  I highly recommend using us to go in as the tomcat
> user and making sure it works under those credentials.
> 
> 2. Download commons-daemon.  If you can find binaries for REHL4, go for
> it.  Otherwise you may have to build it -- as I remember it's very easy.
> 
> 3. Customize the sample start/stop script and place where all the others
> are (my Mandrake system has them in /etc/init.d)
> 
> 4. Place a sym link to the init script in the requisite /etc/rc#.d
> folder for starting on that run level.
> 
> --David
> 
> Prashant Thakkar wrote:
> 
> > Hi,
> >
> > I would like to know how i can run tomcat5.0 as a deoman on REHL4.
> >
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org




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


Mime
View raw message