setup revision 873
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# CDDL HEADER START
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# The contents of this file are subject to the terms of the
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# Common Development and Distribution License, Version 1.0 only
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# (the "License"). You may not use this file except in compliance
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# with the License.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# You can obtain a copy of the license at
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# trunk/opends/resource/legal-notices/OpenDS.LICENSE
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# See the License for the specific language governing permissions
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# and limitations under the License.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# When distributing Covered Code, include this CDDL HEADER in each
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# file and include the License file at
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov# add the following below this CDDL HEADER, with the fields enclosed
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov# by brackets "[]" replaced with your own identifying information:
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# Portions Copyright [yyyy] [name of copyright owner]
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# CDDL HEADER END
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# Portions Copyright 2006-2007 Sun Microsystems, Inc.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# See if JAVA_HOME is set. If not, then see if there is a java executable in
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# the path and try to figure it out.
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amoreif test -z "${JAVA_BIN}"
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore if test -z "${JAVA_HOME}"
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore if test -f "${INSTANCE_ROOT}/bin/set-java-home"
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore . "${INSTANCE_ROOT}/bin/set-java-home"
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore echo "Please set JAVA_HOME to the root of a Java 5.0 installation."
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov# system environment variables for security and compatibility reasons.
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankovexport PATH LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64 \
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov# Capture the current working directory so that we can change to it later.
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov# Then capture the location of this script and the Directory Server instance
95c635efb7c3b86efc493e0447eaec7aecca3f0fGarrett D'Amore# root so that we can use them to create appropriate paths.
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankovcd "${WORKING_DIR}"
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov# Configure the appropriate CLASSPATH.
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov# Determine whether the detected Java environment is acceptable for use.
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankovif test -z "${JAVA_ARGS}"
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov "${JAVA_BIN}" -client org.opends.server.tools.InstallDS -t 2> /dev/null
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov "${JAVA_BIN}" org.opends.server.tools.InstallDS -t 2> /dev/null
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov echo "ERROR: The detected Java version could not be used. Please set "
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov echo " JAVA_HOME to the root of a Java 5.0 installation."
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov "${JAVA_BIN}" ${JAVA_ARGS} org.opends.server.tools.InstallDS -t 2> /dev/null
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov echo "ERROR: The detected Java version could not be used. Please set "
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov echo " JAVA_HOME to the root of a Java 5.0 installation."
260e9a87725c090ba5835b1f9f0b62fa2f96036fYuri Pankov# Launch the setup process.