start-ds revision 2976
f4d965ae26bc0c8c1c20cb5109507159e91313e8covener# CDDL HEADER START
6a23db45a67f5ef8210e79b9b5626a0b898d8d39trawick# The contents of this file are subject to the terms of the
6a23db45a67f5ef8210e79b9b5626a0b898d8d39trawick# Common Development and Distribution License, Version 1.0 only
49487586e883b50aa47a1da04f1d7ccb78e70b7dylavic# (the "License"). You may not use this file except in compliance
06bb3e11d3e997937534ae7bd45b3631d3b5e5bacovener# with the License.
06bb3e11d3e997937534ae7bd45b3631d3b5e5bacovener# You can obtain a copy of the license at
72f87451163dbeec3a4802a82235d9f91e07defftrawick# See the License for the specific language governing permissions
72f87451163dbeec3a4802a82235d9f91e07defftrawick# and limitations under the License.
dc0d0ed622bd252af5bed214579a3148e65c369eylavic# When distributing Covered Code, include this CDDL HEADER in each
dc0d0ed622bd252af5bed214579a3148e65c369eylavic# file and include the License file at
5ef3c61605a3a021ff71f488983cb0065f8e1a79covener# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
fb1985a97912b25ec6564c73e610a31e5fc6e25fcovener# add the following below this CDDL HEADER, with the fields enclosed
09c87c777bed1655621bb20e1c46cb6b1a63279dcovener# by brackets "[]" replaced with your own identifying information:
cf8b985ec0a63b15a1c8f2990d96009a11e0d68ecovener# Portions Copyright [yyyy] [name of copyright owner]
cf8b985ec0a63b15a1c8f2990d96009a11e0d68ecovener# CDDL HEADER END
6bbcfe3fb8489d6e87770d37d97b7a5cd4fabceeylavic# Portions Copyright 2006-2007 Sun Microsystems, Inc.
420f251223a59477a211837382d0622efd42a6bdylavic# Capture the current working directory so that we can change to it later.
420f251223a59477a211837382d0622efd42a6bdylavic# Then capture the location of this script and the Directory Server instance
6502b7b32f980cc2093bb3ebce37e5e4dc68fba4ylavic# root so that we can use them to create appropriate paths.
c1a63b8fad09c419c1a64f75993feb8a343a6801ylaviccd "${WORKING_DIR}"
c1a63b8fad09c419c1a64f75993feb8a343a6801ylavic# Specify the locations of important files that may be used when the server
e6b4bd1113567627ab6bb6c6a7105e1e01a7d889jailletc# is starting.
04983e3bd1754764eec7d6bb772fe3b0bf391771jorton# Specify the script name so that it may be provided in command-line usage.
15660979a30d251681463de2e0584853890082accovener# Set environment variables
cfd9415521847b2f9394fad04fb701cfb955f503rjung. "${INSTANCE_ROOT}/lib/_script-util.sh"
8491e0600f69b0405e156ea8a419653c065c645bcovener# See if the provided set of arguments were sufficient for us to be able to
63b9f1f5880391261705f696d7d65507bbe9ace3covener# start the server or perform the requested operation. An exit code of 99
63b9f1f5880391261705f696d7d65507bbe9ace3covener# means that it should be possible to start the server. An exit code of 98
63b9f1f5880391261705f696d7d65507bbe9ace3covener# means that the server is already running and we shouldn't try to start it.
87a26948305eab2bab8a4fb3f2a21f6725055790covener# An exit code of anything else means that we're not trying to start the server
87a26948305eab2bab8a4fb3f2a21f6725055790covener# and we can just exit with that exit code.
87a26948305eab2bab8a4fb3f2a21f6725055790covener${OPENDS_JAVA_BIN} ${SCRIPT_NAME_ARG} org.opends.server.core.DirectoryServer \
4efd27d2bd53a819a194f8a942f8881c1927755eylavic --configClass org.opends.server.extensions.ConfigFileHandler \
4efd27d2bd53a819a194f8a942f8881c1927755eylavic --configFile "${CONFIG_FILE}" --checkStartability "${@}"
983528026996668ea295be95aedb9c7a346af470ylavic # run detach
249ab52ef73a2b33446ae07904e3526b57251411ylavic nohup "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} ${SCRIPT_NAME_ARG} \
1f0836d4b1a203c7b375daae691beb95f6036205ylavic --configClass org.opends.server.extensions.ConfigFileHandler \
1f0836d4b1a203c7b375daae691beb95f6036205ylavic --configFile "${CONFIG_FILE}" "${@}" > "${LOG_FILE}" 2>&1 &
3b11e6ec1c5273d6a8968460db650e7ca99c49c0ylavic echo $! > "${PID_FILE}"
01402a0fbec8bd11f6c10d8ef9c9cceac68bb787ylavic "${OPENDS_JAVA_BIN}" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete \
01402a0fbec8bd11f6c10d8ef9c9cceac68bb787ylavic --targetFile "${STARTING_FILE}" --logFile "${LOG_FILE}"
49dacedb6c387b786b7911082ff35121a45f414bcovener "${OPENDS_JAVA_BIN}" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete \
3c990331fc6702119e4f5b8ba9eae3021aea5265jim # An exit code of 98 means that the server is already running.
3c990331fc6702119e4f5b8ba9eae3021aea5265jim ${OPENDS_JAVA_BIN} ${SCRIPT_NAME_ARG} org.opends.server.core.DirectoryServer \
fc42512879dd0504532f52fe5d0d0383dda96a1eniq --configClass org.opends.server.extensions.ConfigFileHandler \
fc42512879dd0504532f52fe5d0d0383dda96a1eniq --configFile "${CONFIG_FILE}" --checkStartability > /dev/null 2>&1
983528026996668ea295be95aedb9c7a346af470ylavic # Could not start the server
259878293a997ff49f5ddfc53d3739cbdc25444ecovener # run no detach
15890c9306ba98f6fc243e15a3c4778ddc7d773erpluem echo $$ > "${PID_FILE}"
b54b024c06a19926832d77d40ba35ad8c41e4d3dminfrin exec "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} ${SCRIPT_NAME_ARG} \
65967d05f839dbf27cf91d91fa79585eeae19660minfrin --configClass org.opends.server.extensions.ConfigFileHandler \
8152945ae46857b170cb227e79bb799f4fc7710dminfrin # an error or the server is already started. Just return the code provided
8152945ae46857b170cb227e79bb799f4fc7710dminfrin # by checkstartability