You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jean-Luc BEAUDET <be...@toolchest.cyber.kodak.com> on 2002/06/06 12:05:18 UTC

Automatic start from /etc/rc3.d ???

Hi all,

Using SOLARIS 2.8, Tomcat 4.0.2 on a SUN 220R Server

Well my Tomcat engine is runnin' under a special user, let's say
wildcat.

I'm  looking for a way to automatically start this engine at system
boot, like i do with Apache.

Apache has a special way - start by root and change user to handle the
processes - to do the trick, but not Tomcat.

Does any one knows about a restriction to use smth like su wildtiger -c
'$TOMCAT_HOME/bin/startup.sh'...

Any suggestions welcome.

Jean-Luc :O)



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Automatic start from /etc/rc3.d ???

Posted by Jean-Luc BEAUDET <be...@toolchest.cyber.kodak.com>.
Alexander ten Bruggencate a щcrit :

> On Thu, 2002-06-06 at 12:05, Jean-Luc BEAUDET wrote:
> > Hi all,
>
> > Well my Tomcat engine is runnin' under a special user, let's say
> > wildcat.
> >
> > I'm  looking for a way to automatically start this engine at system
> > boot, like i do with Apache.
> >
> > Jean-Luc :O)
>
> here's my /etc/rc.d/initd/tomcat script.
>
> to start oracle / tomcat / apache (in that order) with linux i just make
> symbollic links like:
>
> [/etc/rc.d/rc5.d] S82tomcat -> ../init.d/tomcat
>
> hope that helps...
> -Alexander.
>
> #!/bin/sh
> #
>
> # Source function library.
> . /etc/rc.d/init.d/functions
>
> # Source networking configuration.
> . /etc/sysconfig/network
>
> TOMCAT_HOME=/home/bruggenc/tomcat
> TOMCAT_OWNER=bruggenc
> export JAVA_HOME=/usr/java/j2sdk1.4.0
>
> if [ ! -f $TOMCAT_HOME/bin/startup.sh -o ! -d $TOMCAT_HOME ]; then
>         echo "Tomcat startup: cannot start"
>         exit
> fi
>
> # See how we were called.
> case "$1" in
>   start)
>         echo -n "Starting Tomcat: "
>         su - $TOMCAT_OWNER -c $TOMCAT_HOME/bin/startup.sh
>         echo
>         touch /var/lock/subsys/tomcat
>         ;;
>   stop)
>         # Stop daemons.
>         echo -n "Shutting down Tomcat: "
>         su - $TOMCAT_OWNER -c $TOMCAT_HOME/bin/shutdown.sh
>         echo
>         rm -f /var/lock/subsys/tomcat
>         ;;
>   restart)
>         $0 stop
>         $0 start
>         ;;
>   status)
>         ;;
>   *)
>         echo "Usage: tomcat {start|stop|restart|status}"
>         exit 1
> esac
>
> exit 0
>
>   ------------------------------------------------------------------------
>                        Name: signature.asc
>    signature.asc       Type: application/pgp-signature
>                 Description: This is a digitally signed message part

Alexander,

It looks like exactly what i need.

Thank for all.

JL :O)



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Automatic start from /etc/rc3.d ???

Posted by Alexander ten Bruggencate <al...@bruggencate.com>.
On Thu, 2002-06-06 at 12:05, Jean-Luc BEAUDET wrote:
> Hi all,

> Well my Tomcat engine is runnin' under a special user, let's say
> wildcat.
> 
> I'm  looking for a way to automatically start this engine at system
> boot, like i do with Apache.
> 
> Jean-Luc :O)

here's my /etc/rc.d/initd/tomcat script.

to start oracle / tomcat / apache (in that order) with linux i just make
symbollic links like:

[/etc/rc.d/rc5.d] S82tomcat -> ../init.d/tomcat 

hope that helps...
-Alexander.

#!/bin/sh
#

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

TOMCAT_HOME=/home/bruggenc/tomcat
TOMCAT_OWNER=bruggenc
export JAVA_HOME=/usr/java/j2sdk1.4.0

if [ ! -f $TOMCAT_HOME/bin/startup.sh -o ! -d $TOMCAT_HOME ]; then
        echo "Tomcat startup: cannot start"
        exit
fi

# See how we were called.
case "$1" in
  start)
        echo -n "Starting Tomcat: "
        su - $TOMCAT_OWNER -c $TOMCAT_HOME/bin/startup.sh
        echo
        touch /var/lock/subsys/tomcat
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down Tomcat: "
        su - $TOMCAT_OWNER -c $TOMCAT_HOME/bin/shutdown.sh
        echo
        rm -f /var/lock/subsys/tomcat
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  status)
        ;;
  *)
	echo "Usage: tomcat {start|stop|restart|status}"
        exit 1
esac

exit 0


Re: Automatic start from /etc/rc3.d ???

Posted by Jean-Luc BEAUDET <be...@toolchest.cyber.kodak.com>.
Phillip Morelock a щcrit :

> su -c
>
> see
> man su
>
> Oh, wait, I see that you know that already --
>
> For me I had to symlink to tomcat.sh and init will automatically call it
> with "start" and "stop" arguments:
>
> tomcat.sh start
> and on shutdown:
> tomcat.sh stop
>
> which is essentially what startup.sh and shutdown.sh do.
>
> This worked for me on Linux, don't know Sun, sorry.
>
> cheers
> fillup
>
> On 6/6/02 3:05 AM, "Jean-Luc BEAUDET" <be...@toolchest.cyber.kodak.com>
> wrote:
>
> > Hi all,
> >
> > Using SOLARIS 2.8, Tomcat 4.0.2 on a SUN 220R Server
> >
> > Well my Tomcat engine is runnin' under a special user, let's say
> > wildcat.
> >
> > I'm  looking for a way to automatically start this engine at system
> > boot, like i do with Apache.
> >
> > Apache has a special way - start by root and change user to handle the
> > processes - to do the trick, but not Tomcat.
> >
> > Does any one knows about a restriction to use smth like su wildtiger -c
> > '$TOMCAT_HOME/bin/startup.sh'...
> >
> > Any suggestions welcome.
> >
> > Jean-Luc :O)
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

Thanks for yur help.

JL :O)



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Automatic start from /etc/rc3.d ???

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
> Oh and you'll probably want to define:
> 
> JAVA_HOME
> CATALINA_HOME
> (or TOMCAT_HOME as appropriate)
> 
> directly inside of tomcat.sh or catalina.sh

Has anyone had problems with this? I'm experiencing startup problems. The script is all setup *that* way and running it manually when the system is in Run Level 3 starts it up, just fine. However, when system boots, Tomcat starts and keeps running for 5 to 10 seconds, then it just plain exits. Nothing in error logs (except "catalina starting"), nothing on the console.

I will add that this is Tru64 UNIX 4.0D (Digital UNIX or DEC OSF/1) and I had problems with the startup scripts, due to some shell quirkiness. That has been resolved by some simple change in the scripts. Is it a problem for Catalina if it looses STDIN/STDOUT while attempting to startup? Because, that is the only big difference in boot startup and manual startup.

Nix.

Re: Automatic start from /etc/rc3.d ???

Posted by Phillip Morelock <su...@phillipmorelock.com>.
Oh and you'll probably want to define:

JAVA_HOME
CATALINA_HOME
(or TOMCAT_HOME as appropriate)

directly inside of tomcat.sh or catalina.sh

cheers
fillup


On 6/6/02 3:17 AM, "Phillip Morelock" <su...@phillipmorelock.com>
wrote:

> su -c
> 
> see
> man su
> 
> Oh, wait, I see that you know that already --
> 
> For me I had to symlink to tomcat.sh and init will automatically call it
> with "start" and "stop" arguments:
> 
> tomcat.sh start
> and on shutdown:
> tomcat.sh stop
> 
> which is essentially what startup.sh and shutdown.sh do.
> 
> This worked for me on Linux, don't know Sun, sorry.
> 
> cheers
> fillup
> 
> On 6/6/02 3:05 AM, "Jean-Luc BEAUDET" <be...@toolchest.cyber.kodak.com>
> wrote:
> 
>> Hi all,
>> 
>> Using SOLARIS 2.8, Tomcat 4.0.2 on a SUN 220R Server
>> 
>> Well my Tomcat engine is runnin' under a special user, let's say
>> wildcat.
>> 
>> I'm  looking for a way to automatically start this engine at system
>> boot, like i do with Apache.
>> 
>> Apache has a special way - start by root and change user to handle the
>> processes - to do the trick, but not Tomcat.
>> 
>> Does any one knows about a restriction to use smth like su wildtiger -c
>> '$TOMCAT_HOME/bin/startup.sh'...
>> 
>> Any suggestions welcome.
>> 
>> Jean-Luc :O)
>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>> For additional commands, e-mail: <ma...@jakarta.apache.org>
>> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Automatic start from /etc/rc3.d ???

Posted by Phillip Morelock <su...@phillipmorelock.com>.
su -c

see
man su

Oh, wait, I see that you know that already --

For me I had to symlink to tomcat.sh and init will automatically call it
with "start" and "stop" arguments:

tomcat.sh start
and on shutdown:
tomcat.sh stop

which is essentially what startup.sh and shutdown.sh do.

This worked for me on Linux, don't know Sun, sorry.

cheers
fillup

On 6/6/02 3:05 AM, "Jean-Luc BEAUDET" <be...@toolchest.cyber.kodak.com>
wrote:

> Hi all,
> 
> Using SOLARIS 2.8, Tomcat 4.0.2 on a SUN 220R Server
> 
> Well my Tomcat engine is runnin' under a special user, let's say
> wildcat.
> 
> I'm  looking for a way to automatically start this engine at system
> boot, like i do with Apache.
> 
> Apache has a special way - start by root and change user to handle the
> processes - to do the trick, but not Tomcat.
> 
> Does any one knows about a restriction to use smth like su wildtiger -c
> '$TOMCAT_HOME/bin/startup.sh'...
> 
> Any suggestions welcome.
> 
> Jean-Luc :O)
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>