start-ds revision 486
2ad080048d86cc499a05750422d99a4b54da9e6dwrowe# CDDL HEADER START
a601d863bd772fefc4dc82a883589d8be6a44811wrowe# The contents of this file are subject to the terms of the
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# Common Development and Distribution License, Version 1.0 only
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# (the "License"). You may not use this file except in compliance
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# with the License.
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# You can obtain a copy of the license at
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# See the License for the specific language governing permissions
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# and limitations under the License.
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# When distributing Covered Code, include this CDDL HEADER in each
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# file and include the License file at
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# add the following below this CDDL HEADER, with the fields enclosed
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# by brackets "[]" replaced with your own identifying * information:
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# Portions Copyright [yyyy] [name of copyright owner]
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# CDDL HEADER END
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# Portions Copyright 2006 Sun Microsystems, Inc.
b96d47f210d6523eaa51543168f0ee910f19b227slive# See if JAVA_HOME is set. If not, then see if there is a java executable in
b96d47f210d6523eaa51543168f0ee910f19b227slive# the path and try to figure it out.
b96d47f210d6523eaa51543168f0ee910f19b227sliveif test -z "${JAVA_BIN}"
b96d47f210d6523eaa51543168f0ee910f19b227slive if test -z "${JAVA_HOME}"
b96d47f210d6523eaa51543168f0ee910f19b227slive echo "Please set JAVA_HOME to the root of a Java 5.0 installation."
b96d47f210d6523eaa51543168f0ee910f19b227slive# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important
b96d47f210d6523eaa51543168f0ee910f19b227slive# system environment variables for security and compatibility reasons.
b96d47f210d6523eaa51543168f0ee910f19b227sliveexport PATH LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64 \
b96d47f210d6523eaa51543168f0ee910f19b227slive# Capture the current working directory so that we can change to it later.
b96d47f210d6523eaa51543168f0ee910f19b227slive# Then capture the location of this script and the Directory Server instance
b96d47f210d6523eaa51543168f0ee910f19b227slive# root so that we can use them to create appropriate paths.
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowecd "${WORKING_DIR}"
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# Configure the appropriate CLASSPATH.
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# Specify the locations of important files that may be used when the server
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# is starting.
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# See if "-nodetach" was specified as the first command-line argument. If it
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# was, then don't use nohup to send to the background, and send all output to
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe# both the console and a log file.
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe echo $$ > "${PID_FILE}"
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe --configClass org.opends.server.extensions.ConfigFileHandler \
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe --configClass org.opends.server.extensions.ConfigFileHandler \
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe --configFile "${CONFIG_FILE}" "${@}" > "${LOG_FILE}" 2>&1 &
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe echo $! > "${PID_FILE}"
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe "${JAVA_BIN}" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete \
998d56ea74f8cc733b423da076dadb0fd0a789f3wrowe --targetFile "${STARTING_FILE}" --logFile "${LOG_FILE}"