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