start-ds revision 7070667c2dffad87009999bdeb16d5305e0afdbe
97a9a944b5887e91042b019776c41d5dd74557aferikabele# CDDL HEADER START
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive# The contents of this file are subject to the terms of the
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive# Common Development and Distribution License, Version 1.0 only
b686b6a420bde7f78c416b90be11db94cb789979nd# (the "License"). You may not use this file except in compliance
b686b6a420bde7f78c416b90be11db94cb789979nd# with the License.
b686b6a420bde7f78c416b90be11db94cb789979nd# You can obtain a copy of the license at
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# See the License for the specific language governing permissions
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# and limitations under the License.
b686b6a420bde7f78c416b90be11db94cb789979nd# When distributing Covered Code, include this CDDL HEADER in each
b686b6a420bde7f78c416b90be11db94cb789979nd# file and include the License file at
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# add the following below this CDDL HEADER, with the fields enclosed
b686b6a420bde7f78c416b90be11db94cb789979nd# by brackets "[]" replaced with your own identifying information:
b686b6a420bde7f78c416b90be11db94cb789979nd# Portions Copyright [yyyy] [name of copyright owner]
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# CDDL HEADER END
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd# Portions Copyright 2006-2007 Sun Microsystems, Inc.
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd# Capture the current working directory so that we can change to it later.
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung# Then capture the location of this script and the Directory Server instance
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd# root so that we can use them to create appropriate paths.
06ba4a61654b3763ad65f52283832ebf058fdf1cslivecd "${WORKING_DIR}"
b686b6a420bde7f78c416b90be11db94cb789979nd# See if JAVA_HOME is set. If not, then see if there is a java executable in
b686b6a420bde7f78c416b90be11db94cb789979nd# the path and try to figure it out.
117c1f888a14e73cdd821dc6c23eb0411144a41cndif test -z "${JAVA_BIN}"
b686b6a420bde7f78c416b90be11db94cb789979nd if test -z "${JAVA_HOME}"
b686b6a420bde7f78c416b90be11db94cb789979nd if test -f "${INSTANCE_ROOT}/bin/set-java-home"
b686b6a420bde7f78c416b90be11db94cb789979nd . "${INSTANCE_ROOT}/bin/set-java-home"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo "Please set JAVA_HOME to the root of a Java 5.0 installation."
3b58542e01ec69422f3086db5825a12fc77b726end# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important
3b58542e01ec69422f3086db5825a12fc77b726end# system environment variables for security and compatibility reasons.
69d3d5f6232f961fd77392db8a975a346fd9cff6ndexport PATH LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64 \
69d3d5f6232f961fd77392db8a975a346fd9cff6nd# Configure the appropriate CLASSPATH.
69d3d5f6232f961fd77392db8a975a346fd9cff6nd# Specify the locations of important files that may be used when the server
69d3d5f6232f961fd77392db8a975a346fd9cff6nd# is starting.
3b58542e01ec69422f3086db5825a12fc77b726end# Specify the script name so that it may be provided in command-line usage.
17ade6df5ec233536985eb1c130a906c725dd614humbedooh# See if the provided set of arguments were sufficient for us to be able to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# start the server or perform the requested operation. An exit code of 99
06ba4a61654b3763ad65f52283832ebf058fdf1cslive# means that it should be possible to start the server. An exit code of 98
3b58542e01ec69422f3086db5825a12fc77b726end# means that the server is already running and we shouldn't try to start it.
3b58542e01ec69422f3086db5825a12fc77b726end# An exit code of anything else means that we're not trying to start the server
3b58542e01ec69422f3086db5825a12fc77b726end# and we can just exit with that exit code.
3b58542e01ec69422f3086db5825a12fc77b726end${JAVA_BIN} ${SCRIPT_NAME_ARG} org.opends.server.core.DirectoryServer \
3b58542e01ec69422f3086db5825a12fc77b726end --configClass org.opends.server.extensions.ConfigFileHandler \
17ade6df5ec233536985eb1c130a906c725dd614humbedooh # run detach
3b58542e01ec69422f3086db5825a12fc77b726end --configClass org.opends.server.extensions.ConfigFileHandler \
3b58542e01ec69422f3086db5825a12fc77b726end --configFile "${CONFIG_FILE}" "${@}" > "${LOG_FILE}" 2>&1 &
06ba4a61654b3763ad65f52283832ebf058fdf1cslive echo $! > "${PID_FILE}"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "${JAVA_BIN}" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete \
17ade6df5ec233536985eb1c130a906c725dd614humbedooh # run no detach
3b58542e01ec69422f3086db5825a12fc77b726end echo $$ > "${PID_FILE}"
3b58542e01ec69422f3086db5825a12fc77b726end --configClass org.opends.server.extensions.ConfigFileHandler \
3b58542e01ec69422f3086db5825a12fc77b726end # an error or the server is already started. Just return the code provided
3b58542e01ec69422f3086db5825a12fc77b726end # by checkstartability