tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Turner, John" <JTur...@AAS.com>
Subject RE: Tomcat 4.0.4 init.d startup script
Date Mon, 05 Aug 2002 14:48:50 GMT

How does CATALINA_HOME get set before this script even runs?  From the error
message, it looks to me like CATALINA_HOME is null.  I see that you are
exporting CATALINA_HOME and the other variables, but I don't see them ever
getting set.

If you want to use CATALINA_HOME in your script, set it in the script, like
this:

CATALINA_HOME=/some/path/to/tomcat
$CATALINA_HOME/bin/catalina.sh start $2>&1

John Turner
jturner@NOSPAM.aas.com

-----Original Message-----
From: Richard Fox [mailto:rfox@sbsii.com]
Sent: Monday, August 05, 2002 10:38 AM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat 4.0.4 init.d startup script 


Hi,

I am running Tomcat successfully on my RH 7.3 system with Apache. I want to
start tomcat automatically, of course, but am having a devil of a time
writing a startup script for init.d (I am no expert on shell scripts).
Currently I run Tomcat by hand with
/var/jakarta-tomcat-4.0.4/bin/startup.sh. I don't see a script that I can
copy to /etc/init.d. Could someone please provide me with this script? I am
sure it has been written thosands of times. Alternatively, I would really
appreciate help determining what is wrong with my current script, which
follows:

Here is the error when I run the script from the command line:

[rfox@thor bin]$ /etc/init.d/tomcat4 start
': not a valid identifierrt: `
/bin/catalina.sh: No such file or directory/jakarta-tomcat-4.0.4

Here is my script:

#!/bin/sh
#
# Startup script for the Apache Tomcat JSP/Servlet Container
#
# chkconfig: 345 85 15
# description: Apache Tomcat is a JSP/Servlet container.  It is used to
serve \
#              JSP pages and "execute" servlets.
# processname: XXX - fixme - XXX
# pidfile: none
# lockfile: /var/lock/subsys/tomcat4
# config: $CATALINA_HOME/conf/server.xml
# config: /etc/sysconfig/tomcat4

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

# Source additional OPTIONS if we have them.
if [ -f /etc/sysconfig/tomcat4 ] ; then
    . /etc/sysconfig/tomcat4
fi
prog=tomcat4

start() {
    echo -n $"Starting $prog: "
    ${CATALINA_HOME}/bin/catalina.sh start $2>&1
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && touch /var/lock/subsys/tomcat4
    return $RETVAL
}
stop() {
    echo -n $"Stopping $prog: "
    ${CATALINA_HOME}/bin/catalina.sh stop $2>&1
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && rm -f /var/lock/subsys/tomcat4 /var/run/tomcat4.pid
}
status() {
    echo -n $"Status $prog: not implemented yet!"
    echo
    RETVAL=1
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    sleep 20
    start
    ;;
  *)
    echo $"Usage: $prog {start|stop|restart}"
    exit 1
esac

exit $RETVAL

Here is my /etc/sysconfig/tomcat4:

export JAVA_HOME=/usr/java/j2sdk1.4.0
export CATALINA_BASE=/var/jakarta-tomcat-4.0.4
export CATALINA_HOME=$CATALINA_BASE


tia,

Rich
rfox@sbsii.com


--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message