Hello:

I am running Tomcat 3.2.1 on RedHat Linux 7.0.
I am trying to get tomcat to automatically start and stop when I reboot
my server.

My server is not local, so I am looking thru /var/log/messages.  

I seeing messages for when tomcat starts up:

Feb 15 12:44:22 neil235 tomcat: Starting tomcat:
Feb 15 12:44:22 neil235 tomcat: Guessing TOMCAT_HOME from tomcat.sh to
/usr/loca
l/jakarta-tomcat-3.2.1/bin/..
Feb 15 12:44:22 neil235 tomcat: Setting TOMCAT_HOME to
/usr/local/jakarta-tomcat
-3.2.1/bin/..
Feb 15 12:44:22 neil235 tomcat: Using classpath:
/usr/local/jakarta-tomcat-3.2.1
/bin/../lib/ant.jar:/usr/local/jakarta-tomcat-3.2.1/bin/../lib/jasper.jar:/usr/l
ocal/jakarta-tomcat-3.2.1/bin/../lib/jaxp.jar:/usr/local/jakarta-tomcat-3.2.1/bi
n/../lib/parser.jar:/usr/local/jakarta-tomcat-3.2.1/bin/../lib/servlet.jar:/usr/
local/jakarta-tomcat-3.2.1/bin/../lib/test:/usr/local/jakarta-tomcat-3.2.1/bin/.
./lib/webserver.jar:/usr/local/j2sdk1.3.0/lib/tools.jar
Feb 15 12:44:23 neil235 rc: Starting tomcat:  succeeded

But, I dont see any messages among the shutdown messages in
that file when the server shuts down for a reboot.

Here is exactly what I did:

First, I placed the following lines in a file /etc/rc.d/init.d/tomcat:
#!/bin/sh
# Starts tomcat.
#
# Source function library.
. /etc/rc.d/init.d/functions

RETVAL=0

# See how we were called.
case "$1" in
  start)
        echo -n "Starting tomcat: "
                                export JAVA_HOME=/usr/local/j2sdk1.3.0
        /usr/local/jakarta-tomcat-3.2.1/bin/startup.sh
        RETVAL=$?
        ;;
  stop)
        echo -n "Shutting down tomcat: "
        /usr/local/jakarta-tomcat-3.2.1/bin/shutdown.sh
        echo
        RETVAL=$?
        ;;
  restart)
        /usr/local/jakarta-tomcat-3.2.1/bin/shutdown.sh
        /usr/local/jakarta-tomcat-3.2.1/bin/startup.sh
        ;;
  *)
        echo "Usage: tomcat {start|stop|restart}"
        exit 1
esac

exit $RETVAL

Next, I issued the following commands:
chmod +x /etc/init.d/tomcat
rm -f /etc/rc3.d/S75tomcat
rm -f /etc/rc0.d/K25tomcat
rm -f /etc/rc6.d/K25tomcat
ln -s /etc/rc.d/init.d/tomcat /etc/rc3.d/S75tomcat
ln -s /etc/rc.d/init.d/tomcat /etc/rc0.d/K25tomcat
ln -s /etc/rc.d/init.d/tomcat /etc/rc6.d/K25tomcat

Finally, I rebooted the server:
        /sbin/reboot

I did check that I can run the commands manually
/etc/rc.d/init.d/tomcat start
/etc/rc.d/init.d/tomcat stop
Work as I intend them to do so.

I just dont understand why this is not working.  This makes
no sense to me.  The startup command is working.  I dont 
understand why the stop command is not -- it uses the same
file.

Anybody have any ideas?

Thanks,
        Neil.

--
Neil Aggarwal
JAMM Consulting, Inc. -- (972) 612-6056, http://www.JAMMConsulting.com
Custom Internet Development -- Java, JSP, servlets, databases

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to