stop-ds.bat revision 961
0N/A
0N/A@echo off
0N/Arem CDDL HEADER START
0N/Arem
0N/Arem The contents of this file are subject to the terms of the
0N/Arem Common Development and Distribution License, Version 1.0 only
0N/Arem (the "License"). You may not use this file except in compliance
0N/Arem with the License.
0N/Arem
0N/Arem You can obtain a copy of the license at
0N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/Arem or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/Arem See the License for the specific language governing permissions
0N/Arem and limitations under the License.
0N/Arem
0N/Arem When distributing Covered Code, include this CDDL HEADER in each
0N/Arem file and include the License file at
0N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
0N/Arem add the following below this CDDL HEADER, with the fields enclosed
873N/Arem by brackets "[]" replaced with your own identifying information:
0N/Arem Portions Copyright [yyyy] [name of copyright owner]
0N/Arem
0N/Arem CDDL HEADER END
0N/Arem
0N/Arem
4495N/Arem Portions Copyright 2006-2007 Sun Microsystems, Inc.
0N/A
0N/Asetlocal
0N/A
857N/Aset PATH=%SystemRoot%
857N/A
481N/Aset OPENDS_INVOKE_CLASS="org.opends.server.tools.StopDS"
3266N/Aset SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=stop-ds"
1920N/Aset DIR_HOME=%~dP0..
828N/A
3196N/A:checkJavaBin
3196N/Aif "%JAVA_BIN%" == "" goto noJavaBin
3196N/Agoto setClassPath
3196N/A
3196N/A:noJavaBin
3824N/Aif "%JAVA_HOME%" == "" goto noJavaHome
3824N/Aif not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
3824N/Aset JAVA_BIN=%JAVA_HOME%\bin\java.exe
3824N/Agoto setClassPath
3824N/A
3824N/A:noJavaHome
3824N/Aif not exist "%DIR_HOME%\bin\set-java-home.bat" goto noSetJavaHome
3842N/Acall "%DIR_HOME%\bin\set-java-home.bat"
3842N/Aset JAVA_BIN=%JAVA_HOME%\bin\java.exe
3824N/Agoto setClassPath
3842N/A
1298N/A:noSetJavaHome
1301N/Aecho Error: JAVA_HOME environment variable is not set.
1298N/Aecho Please set it to a valid Java 5 installation.
1298N/Agoto end
1298N/A
1298N/A:setClassPath
1298N/AFOR %%x in ("%DIR_HOME%\lib\*.jar") DO call "%DIR_HOME%\bin\setcp.bat" %%x
1298N/A
2976N/A"%JAVA_BIN%" -Xms8M -Xmx8M %SCRIPT_NAME_ARG% org.opends.server.tools.StopDS --checkStoppability %*
2976N/A
4495N/Aif %errorlevel% == 98 goto serverAlreadyStopped
2976N/Aif %errorlevel% == 99 goto startUsingSystemCall
857N/Aif %errorlevel% == 100 goto stopUsingSystemCall
1298N/Aif %errorlevel% == 101 goto restartUsingSystemCall
1298N/Aif %errorlevel% == 102 goto stopUsingProtocol
2650N/Aif %errorlevel% == 103 goto stopAsWindowsService
832N/Aif %errorlevel% == 104 goto restartAsWindowsService
961N/Arem An error or we display usage
961N/Agoto end
961N/A
961N/A:serverAlreadyStopped
961N/Aif exist "%DIR_HOME%\logs\server.pid" erase "%DIR_HOME%\logs\server.pid"
961N/Agoto end
961N/A
961N/A:startUsingSystemCall
961N/A"%DIR_HOME%\bin\start-ds.bat"
832N/Agoto end
961N/A
1298N/A:stopUsingSystemCall
3824N/A"%DIR_HOME%\lib\winlauncher.exe" stop "%DIR_HOME%"
961N/Agoto end
832N/A
961N/A:restartUsingSystemCall
1298N/A"%DIR_HOME%\lib\winlauncher.exe" stop "%DIR_HOME%"
3196N/Aif not %errorlevel% == 0 goto end
3196N/Agoto startUsingSystemCall
3196N/A
3196N/A:stopUsingProtocol
3196N/Acall "%~dP0\_client-script.bat" %*
3196N/Agoto end
3824N/A
961N/A:stopAsWindowsService
832N/A"%JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.StopWindowsService
961N/Agoto end
1298N/A
3824N/A:restartAsWindowsService
961N/A"%JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.StopWindowsService
857N/Aif not %errorlevel% == 0 goto end
961N/A"%JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.StartWindowsService
1298N/A"%JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%DIR_HOME%\logs\server.startingservice"
3824N/Arem Type the contents the winwervice.out file and delete it.
832N/Aif exist "%DIR_HOME%\logs\winservice.out" type "%DIR_HOME%\logs\winservice.out"
961N/Aif exist "%DIR_HOME%\logs\winservice.out" erase "%DIR_HOME%\logs\winservice.out"
857N/Agoto end
961N/A
1298N/A:end
3824N/A
961N/A