mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
01.35.2009 eb0139c8edc492a2ee316fd0624ba1069390bf42
Follow up to the fix for issue 4081 (start-ds and stop-ds fails on Mac OS X with latest JVM).

Use the '-client' option to launch small programs inside the scripts.
4 files modified
36 ■■■■ changed files
opends/resource/bin/start-ds 8 ●●●● patch | view | raw | blame | history
opends/resource/bin/start-ds.bat 14 ●●●● patch | view | raw | blame | history
opends/resource/bin/stop-ds 4 ●●●● patch | view | raw | blame | history
opends/resource/bin/stop-ds.bat 10 ●●●● patch | view | raw | blame | history
opends/resource/bin/start-ds
@@ -91,7 +91,7 @@
# means that the server is already running and we shouldn't try to start it.
# An exit code of anything else means that we're not trying to start the server
# and we can just exit with that exit code.
${OPENDS_JAVA_BIN} ${SCRIPT_NAME_ARG} org.opends.server.core.DirectoryServer \
${OPENDS_JAVA_BIN} -client ${SCRIPT_NAME_ARG} org.opends.server.core.DirectoryServer \
            --configClass org.opends.server.extensions.ConfigFileHandler \
            --configFile "${CONFIG_FILE}" --checkStartability "${@}"
EC=${?}
@@ -108,17 +108,17 @@
  echo $! > "${PID_FILE}"
  if test ${EC} -eq 99
  then
    "${OPENDS_JAVA_BIN}" org.opends.server.tools.WaitForFileDelete \
    "${OPENDS_JAVA_BIN}" -client org.opends.server.tools.WaitForFileDelete \
         --targetFile "${STARTING_FILE}" --logFile "${LOG_FILE}" "${@}"
  else
    "${OPENDS_JAVA_BIN}" org.opends.server.tools.WaitForFileDelete \
    "${OPENDS_JAVA_BIN}" -client org.opends.server.tools.WaitForFileDelete \
         --targetFile "${STARTING_FILE}" "${@}"
  fi
  EC=${?}
  if test ${EC} -eq 0
  then
    # An exit code of 98 means that the server is already running.
    ${OPENDS_JAVA_BIN} ${SCRIPT_NAME_ARG} org.opends.server.core.DirectoryServer \
    ${OPENDS_JAVA_BIN} -client ${SCRIPT_NAME_ARG} org.opends.server.core.DirectoryServer \
            --configClass org.opends.server.extensions.ConfigFileHandler \
            --configFile "${CONFIG_FILE}" --checkStartability > /dev/null 2>&1
    EC=${?}
opends/resource/bin/start-ds.bat
@@ -59,7 +59,7 @@
echo %SCRIPT%: PATH=%PATH% >> %LOG%
"%OPENDS_JAVA_BIN%" %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" --checkStartability %*
"%OPENDS_JAVA_BIN%" -client %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" --checkStartability %*
if %errorlevel% == 98 goto serverAlreadyStarted
if %errorlevel% == 99 goto runDetach
@@ -101,7 +101,7 @@
if exist "%INSTANCE_ROOT%\lib\set-java-args.bat" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat"
"%INSTALL_ROOT%\lib\winlauncher.exe" start "%INSTANCE_ROOT%" "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS%  %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %*
echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.starting" to be deleted >> %LOG%
"%OPENDS_JAVA_BIN%" org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" %*
"%OPENDS_JAVA_BIN%" -client org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" %*
goto checkStarted
:runDetachQuiet
@@ -111,7 +111,7 @@
if exist "%INSTANCE_ROOT%\lib\set-java-args.bat" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat"
"%INSTALL_ROOT%\lib\winlauncher.exe" start "%INSTANCE_ROOT%" "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS%  %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %*
echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.starting" to be deleted >> %LOG%
"%OPENDS_JAVA_BIN%" org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" %* >> %LOG%
"%OPENDS_JAVA_BIN%" -client org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" %* >> %LOG%
goto checkStarted
:runDetachCalledByWinService
@@ -124,22 +124,22 @@
if exist "%INSTANCE_ROOT%\lib\set-java-args.bat" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat"
"%INSTALL_ROOT%\lib\winlauncher.exe" start "%INSTANCE_ROOT%" "%OPENDS_JAVA_BIN%" -Xrs %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %*
echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.starting" to be deleted >> %LOG%
"%OPENDS_JAVA_BIN%" org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" --outputFile "%INSTANCE_ROOT%\logs\winservice.out" %*
"%OPENDS_JAVA_BIN%" -client org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" --outputFile "%INSTANCE_ROOT%\logs\winservice.out" %*
erase "%INSTANCE_ROOT%\logs\server.startingservice"
goto checkStarted
:runAsService
echo %SCRIPT%: Run as service >> %LOG%
"%OPENDS_JAVA_BIN%" org.opends.server.tools.StartWindowsService
"%OPENDS_JAVA_BIN%" -client org.opends.server.tools.StartWindowsService
echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.startingservice" to be deleted >> %LOG%
"%OPENDS_JAVA_BIN%" org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice" %*
"%OPENDS_JAVA_BIN%" -client org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice" %*
rem Type the contents the winwervice.out file and delete it.
if exist "%INSTANCE_ROOT%\logs\winservice.out" type "%INSTANCE_ROOT%\logs\winservice.out"
if exist "%INSTANCE_ROOT%\logs\winservice.out" erase "%INSTANCE_ROOT%\logs\winservice.out"
goto end
:checkStarted
"%OPENDS_JAVA_BIN%" %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" --checkStartability > NUL 2>&1
"%OPENDS_JAVA_BIN%" -client %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" --checkStartability > NUL 2>&1
if %errorlevel% == 98 goto serverStarted
goto serverNotStarted
opends/resource/bin/stop-ds
@@ -164,7 +164,7 @@
    EXIT_CODE=${?}
    if test ${EXIT_CODE} -eq 0
    then
      "${OPENDS_JAVA_BIN}" org.opends.server.tools.WaitForFileDelete \
      "${OPENDS_JAVA_BIN}" -client org.opends.server.tools.WaitForFileDelete \
        --targetFile "${INSTANCE_ROOT}/logs/server.pid" \
        --logFile "${INSTANCE_ROOT}/logs/errors"
      EXIT_CODE=${?}
@@ -225,5 +225,5 @@
fi
# If we've gotten here, then we should try to stop the server over LDAP.
"${OPENDS_JAVA_BIN}" ${JAVA_ARGS} ${SCRIPT_NAME_ARG} \
"${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} ${SCRIPT_NAME_ARG} \
  org.opends.server.tools.StopDS "${@}"
opends/resource/bin/stop-ds.bat
@@ -64,7 +64,7 @@
echo %SCRIPT%: CLASSPATH=%CLASSPATH% >> %LOG%
"%OPENDS_JAVA_BIN%" %SCRIPT_NAME_ARG%  org.opends.server.tools.StopDS --checkStoppability %*
"%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG%  org.opends.server.tools.StopDS --checkStoppability %*
if %errorlevel% == 98 goto serverAlreadyStopped
if %errorlevel% == 99 goto startUsingSystemCall
@@ -110,16 +110,16 @@
:stopAsWindowsService
echo %SCRIPT%: stop as windows service >> %LOG%
"%OPENDS_JAVA_BIN%" org.opends.server.tools.StopWindowsService
"%OPENDS_JAVA_BIN%" -client org.opends.server.tools.StopWindowsService
goto end
:restartAsWindowsService
echo %SCRIPT%: restart as windows service, stopping >> %LOG%
"%OPENDS_JAVA_BIN%" org.opends.server.tools.StopWindowsService
"%OPENDS_JAVA_BIN%" -client org.opends.server.tools.StopWindowsService
if not %errorlevel% == 0 goto end
echo %SCRIPT%: restart as windows service, starting >> %LOG%
"%OPENDS_JAVA_BIN%" org.opends.server.tools.StartWindowsService
"%OPENDS_JAVA_BIN%" org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice"
"%OPENDS_JAVA_BIN%" -client org.opends.server.tools.StartWindowsService
"%OPENDS_JAVA_BIN%" -client org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice"
rem Type the contents the winwervice.out file and delete it.
if exist "%INSTANCE_ROOT%\logs\winservice.out" type "%INSTANCE_ROOT%\logs\winservice.out"
if exist "%INSTANCE_ROOT%\logs\winservice.out" erase "%INSTANCE_ROOT%\logs\winservice.out"