head     1.1;
branch   1.1.1;
access   ;
symbols  initial:1.1.1.1 java_apache:1.1.1;
locks    ; strict;
comment  @# @;


1.1
date     98.05.18.23.37.40;  author ross;  state Exp;
branches 1.1.1.1;
next     ;

1.1.1.1
date     98.05.18.23.37.40;  author ross;  state Exp;
branches ;
next     ;


desc
@@



1.1
log
@Initial revision
@
text
@#!/bin/sh

########################################################
#
# Set-up the JSERV environment
#

#########################################################
#
# The port to listen on.
#
JSERV_PORT=8007

#######################################################
#
# Path to the JServ Wrapper
#
JSERV_BINARY=/usr/local/java-lib/jserv/manual/jserv

#######################################################
#
# Path to file that contains servlet repository 
# information for JServ.
#
JSERV_PROPERTY_FILE=/usr/local/java-lib/jserv/manual/jserv.properties

######################################################
#
# The classpath must at least contains the JDK classes, 
# the JSDK classes, JServ classes. 
#
# It may optionaly contains servlets that you
# don't need to reload or that use native methods.
# (Due to a bug in the current JDK, classes loaded
# through a classloader can't call native methods).
#
JDK_CLASSES=/usr/local/jdk/lib/classes
JSDK_CLASSES=/usr/local/java-lib/JSDK1.0/lib/classes
JSERV_CLASSES=/usr/local/java-lib/jserv/classes
OPTIONAL_CLASSES=

########################################################
#
# Contains the path to java interpreter
#
JAVA_BINARY=/usr/local/jdk/bin/java

#######################################################
#
# File that will contains the pid of JServ
#
JSERV_LOCK_FILE=/var/lock/jserv.pid

#######################################################
#
# File that will contains the pid of JServ
#
JSERV_LOG_FILE=

if [ "${JSERV_LOG_FILE}A" != "A" ] ; then
    JSERV_LOGGING="1>${JSERV_LOG_FILE} 2>&1"
else
    JSERV_LOGGING=""
fi

########################################################
#
# Verify that everything is setup properly
#
if [ ! -r ${JDK_CLASSES} ]; then
    echo "Error: CLASSPATH doesn't contains JDK classes." 
    exit 1
fi

if [ ! -r ${JSDK_CLASSES} ]; then
    echo "Error: CLASSPATH doesn't contains JSDK classes." 
    exit 1
fi

if [ ! -r ${JSERV_CLASSES} ]; then
    echo "Error: CLASSPATH doesn't contains JServ classes." 
    exit 1
fi

CLASSPATH=${JDK_CLASSES}:${JSDK_CLASSES}:${JSERV_CLASSES}

if [ ! -z "${OPTIONAL_CLASSES}" ]; then
    CLASSPATH=${CLASSPATH}:${OPTIONAL_CLASSES}
fi

if [ ! -x ${JSERV_BINARY} ]; then
    echo "Error: Cannot execute JServ-Wrapper"
    exit 1
fi

if [ ! -x ${JAVA_BINARY} ]; then
    echo "Error: Cannot execute Java Interpreter"
    exit 1
fi

if [ ! -r ${JSERV_PROPERTY_FILE} ]; then
    echo "Error: Cannot read ServletAlias configuration file"
    exit 1
fi

#############################################################
#
# Launch everything

export CLASSPATH JAVA_BINARY JSERV_PROPERTY_FILE JSERV_LOCK_FILE JSERV_PORT

## sh is not a pretty language. eval is to interprit
## the logging directive correctly, if present.
eval exec ${JSERV_BINARY} "$@@" ${JSERV_PORT} ${JSERV_LOGGING} &

@


1.1.1.1
log
@
@
text
@@
