head	1.4;
access;
symbols
	JSERV_0_10_PREVIEW:1.3.0.6
	JSERV_0_9_11:1.3.0.4
	JSERV_0_9_12:1.3.0.2
	JSERV0_9_10:1.1
	JSERV0_9_10_DEV_199802091315:1.1
	JSERV_00_09_09:1.1;
locks; strict;
comment	@# @;


1.4
date	98.12.21.14.54.36;	author ed;	state dead;
branches;
next	1.3;

1.3
date	98.03.31.03.40.23;	author ed;	state Exp;
branches;
next	1.2;

1.2
date	98.03.31.02.37.49;	author ed;	state Exp;
branches;
next	1.1;

1.1
date	97.12.05.22.13.27;	author jonbolt;	state Exp;
branches;
next	;


desc
@@


1.4
log
@nuked all the start-jserv stop-jserv restart-jserv files, and replaced with
a single jserv.init
@
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.3
log
@Some fixes -- the code I just put in was messed up, and the
OPTIONAL_CLASSES needed to be quoted when used in [] test operators,
since otherwise it's not optional.

Also, after some experimenting, output redirection is correctly set up,
when configured.

Ed
@
text
@@


1.2
log
@minor change to set up logging of STDERR to a specified file.  The default
is to provide no such definition (which means no change from the current
behavior), but to all the user to create one if they choose.

Ed
@
text
@d8 6
d60 2
a61 2
if [ "${JSERV_LOG_FILE}A" != "A"] then
    JSERV_LOGGING=" >& ${JSERV_LOG_FILE}"
d87 1
a87 1
if [ ! -z ${OPTIONAL_CLASSES} ]; then
d110 6
a115 2
export CLASSPATH JAVA_BINARY JSERV_PROPERTY_FILE JSERV_LOCK_FILE
exec ${JSERV_BINARY} "$@@" ${JSERV_LOGGING} &
@


1.1
log
@added start-jserv
@
text
@d48 12
d105 1
a105 1
exec ${JSERV_BINARY} "$@@" &
@


