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