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

jvergara
01.11.2009 7782bbfd46380d9cc0e2d20f3df54acc1269ebd4
Fix for issue 4081 (start-ds and stop-ds fails on Mac OS X with latest JVM)

The scripts used to impose a maximum and minimum size for the JVM to reduce the time required to launch the JVM when using some small and auxiliary Java programs. This generates ugly errors in some platforms, so the fix consists on playing safe and rely on the JVM ergonomics to launch these programs.
4 files modified
30 ■■■■ changed files
opends/resource/bin/start-ds 4 ●●●● patch | view | raw | blame | history
opends/resource/bin/start-ds.bat 14 ●●●● patch | view | raw | blame | history
opends/resource/bin/stop-ds 2 ●●● patch | view | raw | blame | history
opends/resource/bin/stop-ds.bat 10 ●●●● patch | view | raw | blame | history
opends/resource/bin/start-ds
@@ -108,10 +108,10 @@
  echo $! > "${PID_FILE}"
  if test ${EC} -eq 99
  then
    "${OPENDS_JAVA_BIN}" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete \
    "${OPENDS_JAVA_BIN}" org.opends.server.tools.WaitForFileDelete \
         --targetFile "${STARTING_FILE}" --logFile "${LOG_FILE}" "${@}"
  else
    "${OPENDS_JAVA_BIN}" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete \
    "${OPENDS_JAVA_BIN}" org.opends.server.tools.WaitForFileDelete \
         --targetFile "${STARTING_FILE}" "${@}"
  fi
  EC=${?}
opends/resource/bin/start-ds.bat
@@ -59,7 +59,7 @@
echo %SCRIPT%: PATH=%PATH% >> %LOG%
"%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" --checkStartability %*
"%OPENDS_JAVA_BIN%" %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%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" %*
"%OPENDS_JAVA_BIN%" 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%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" %* >> %LOG%
"%OPENDS_JAVA_BIN%" 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%" -Xms8M -Xmx8M 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%" 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%" -Xms8M -Xmx8M org.opends.server.tools.StartWindowsService
"%OPENDS_JAVA_BIN%" org.opends.server.tools.StartWindowsService
echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.startingservice" to be deleted >> %LOG%
"%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice" %*
"%OPENDS_JAVA_BIN%" 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%" -Xms8M -Xmx8M %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%" %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}" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete \
      "${OPENDS_JAVA_BIN}" org.opends.server.tools.WaitForFileDelete \
        --targetFile "${INSTANCE_ROOT}/logs/server.pid" \
        --logFile "${INSTANCE_ROOT}/logs/errors"
      EXIT_CODE=${?}
opends/resource/bin/stop-ds.bat
@@ -64,7 +64,7 @@
echo %SCRIPT%: CLASSPATH=%CLASSPATH% >> %LOG%
"%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M %SCRIPT_NAME_ARG%  org.opends.server.tools.StopDS --checkStoppability %*
"%OPENDS_JAVA_BIN%" %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%" -Xms8M -Xmx8M org.opends.server.tools.StopWindowsService
"%OPENDS_JAVA_BIN%" org.opends.server.tools.StopWindowsService
goto end
:restartAsWindowsService
echo %SCRIPT%: restart as windows service, stopping >> %LOG%
"%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.StopWindowsService
"%OPENDS_JAVA_BIN%" org.opends.server.tools.StopWindowsService
if not %errorlevel% == 0 goto end
echo %SCRIPT%: restart as windows service, starting >> %LOG%
"%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.StartWindowsService
"%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice"
"%OPENDS_JAVA_BIN%" org.opends.server.tools.StartWindowsService
"%OPENDS_JAVA_BIN%" 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"