You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Prashant Thakkar <pr...@gmail.com> on 2007/05/17 12:48:33 UTC

Tomcat as a deoman

Hi,

I would like to know how i can run tomcat5.0 as a deoman on REHL4.

-- 
Prashant Thakkar

---------------------------------------------------------------------
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


Re: Tomcat as a deoman

Posted by Mark Deneen <md...@gmail.com>.
Attached is the script I use to start/stop tomcat.  The shutdown
method waits a configurable amount of time for the instance to
terminate cleanly and then terminates the process.

Obviously one would need to tweak the script to fit in their
environment.  tomcat-prod goes in /etc/init.d and tomcat-prod.env goes
in /etc/sysconfig.

Mark

On 5/17/07, Prashant Thakkar <pr...@gmail.com> wrote:
> Hi,
>
> I would like to know how i can run tomcat5.0 as a deoman on REHL4.
>
> --
> Prashant Thakkar
>
> ---------------------------------------------------------------------
> 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
>
>


Re: Tomcat as a deoman

Posted by Pid <p...@pidster.com>.
look for jsvc in the tomcat/bin directory, build it and most of the work 
is done for you.

p




Tim Lucia wrote:
> 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
> 
> 


RE: Tomcat as a deoman

Posted by Tim Lucia <ti...@yahoo.com>.
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


Re: Tomcat as a deoman

Posted by David Smith <dn...@cornell.edu>.
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