head	1.1;
access;
symbols
	JSERV_00_09_09:1.1;
locks; strict;
comment	@# @;


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


desc
@@


1.1
log
@added start-jserv
@
text
@#!/bin/sh

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

#######################################################
#
# 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

########################################################
#
# 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
exec ${JSERV_BINARY} "$@@" &
@


