stop-ds revision 873
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Common Development and Distribution License, Version 1.0 only
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# (the "License"). You may not use this file except in compliance
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# You can obtain a copy of the license at
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# trunk/opends/resource/legal-notices/OpenDS.LICENSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# file and include the License file at
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# add the following below this CDDL HEADER, with the fields enclosed
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# by brackets "[]" replaced with your own identifying information:
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# CDDL HEADER END
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Portions Copyright 2006-2007 Sun Microsystems, Inc.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# This script may be used to request that the Directory Server shut down.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# It operates in two different ways, depending on how it is invoked. If it
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# is invoked without any arguments and a local PID file is available, then it
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# will stop the server by sending a TERM signal to the process, and this
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# script will wait until the server has stopped before exiting. If any
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# arguments were provided or there is no local PID file, then it will attempt
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# to stop the server using an LDAP request.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Capture the current working directory so that we can change to it later.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Then capture the location of this script and the Directory Server instance
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# root so that we can use them to create appropriate paths.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynccd "${WORKING_DIR}"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# See if JAVA_HOME is set. If not, then see if there is a java executable in
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# the path and try to figure it out.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncif test -z "${JAVA_BIN}"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync if test -z "${JAVA_HOME}"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync if test -f "${INSTANCE_ROOT}/bin/set-java-home"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync . "${INSTANCE_ROOT}/bin/set-java-home"
export JAVA_BIN
export JAVA_BIN
export CLASSPATH
export SCRIPT_NAME_ARG
EC=${?}
if test -f "${INSTANCE_ROOT}/logs/server.pid"
EXIT_CODE=${?}
EXIT_CODE=${?}
if test -f "${INSTANCE_ROOT}/logs/server.pid"
EXIT_CODE=${?}
exit ${EXIT_CODE}