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

neil_a_wilson
31.37.2006 000ce36733af639bdf36f3389f5b407f79c643da
Change the flag used to start the server in the foreground from "-nodetach"
(with a single dash) to "--nodetach" (with two dashes). It can also be used as
"-N" with a single dash. This has the following benefits:

- It is more consistent with our other command-line arguments, and it is
CLIP compliant.

- It makes it possible for the flag to appear anywhere in the argument list
rather than just being the first argument.

- It makes it possible to provide this feature on Windows, whereas before it
was only available on UNIX-based systems.

- On UNIX-based systems, "--nodetach" is now case-insensitive, although it is
case-sensitive (all lowercase) on Windows systems. The "-N" alternative is
always case sensitive.

OpenDS Issue Number: 900
2 files modified
43 ■■■■ changed files
opends/resource/bin/start-ds 26 ●●●● patch | view | raw | blame | history
opends/resource/bin/start-ds.bat 17 ●●●●● patch | view | raw | blame | history
opends/resource/bin/start-ds
@@ -92,18 +92,32 @@
STARTING_FILE=${INSTANCE_ROOT}/logs/server.starting
# See if "-nodetach" was specified as the first command-line argument.  If it
# was, then don't use nohup to send to the background, and send all output to
# both the console and a log file.
if test "${1}" = "-nodetach"
# See if an "-N" or a "--nodetach" argument was provided as a command-line
# argument.  If it was, then don't use nohup to send to the  background, and
# send all output to both the console and a lot file.
NODETACH=0
for ARG in "${@}"
do
  if test "${ARG}" = "-N"
then
  shift
    NODETACH=1
  else
    ARG=`echo ${ARG} | tr '[A-Z]' '[a-z]'`
    if test "${ARG}" = "--nodetach"
    then
      NODETACH=1
    fi
  fi
done
if test ${NODETACH} -eq 1
then
  echo $$ > "${PID_FILE}"
  rm -f "${PID_FILE}" "${LOG_FILE}"
  exec "${JAVA_BIN}" ${JAVA_ARGS} \
       org.opends.server.core.DirectoryServer \
       --configClass org.opends.server.extensions.ConfigFileHandler \
       --configFile "${CONFIG_FILE}" --noDetach "${@}"
       --configFile "${CONFIG_FILE}" "${@}"
else
  touch "${STARTING_FILE}"
  nohup "${JAVA_BIN}" ${JAVA_ARGS} \
opends/resource/bin/start-ds.bat
@@ -50,10 +50,27 @@
set PATH=%SystemRoot%
set NODETACH=0
for %%x in (%*) DO if "%%x" == "-N" set NODETACH=1
for %%x in (%*) DO if "%%x" == "--nodetach" set NODETACH=1
if "%NODETACH%" == "1" goto runNoDetach
goto runDetach
:runNoDetach
if not exist "%DIR_HOME%\logs\server.out" echo. > "%DIR_HOME%\logs\server.out"
if not exist "%DIR_HOME%\logs\server.starting" echo. > "%DIR_HOME%\logs\server.starting"
"%JAVA_BIN%" %JAVA_ARGS% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %*
goto end
:runDetach
if not exist "%DIR_HOME%\logs\server.out" echo. > "%DIR_HOME%\logs\server.out"
if not exist "%DIR_HOME%\logs\server.starting" echo. > "%DIR_HOME%\logs\server.starting"
start "OpenDS %DIR_HOME%" /B "%JAVA_BIN%" %JAVA_ARGS% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %*
"%JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%DIR_HOME%\logs\server.starting" --logFile "%DIR_HOME%\logs\server.out"
goto end
:end