From 000ce36733af639bdf36f3389f5b407f79c643da Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 31 Oct 2006 19:37:02 +0000
Subject: [PATCH] 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:

---
 opends/resource/bin/start-ds |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/opends/resource/bin/start-ds b/opends/resource/bin/start-ds
index 1472766..af9570c 100755
--- a/opends/resource/bin/start-ds
+++ b/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
+    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
-  shift
   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} \

--
Gitblit v1.10.0