From fe2343005776d1d53a99b3826a2c0d5d2c0f500e Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 22 Feb 2007 13:56:04 +0000
Subject: [PATCH] Update the start-ds script and associated Directory Server code to ensure that the PID file is only written if the server is not already running. If it's not being used to try to start the server, then just invoke the command without a PID file. If it is trying to start the server but the server is already running, then exit with an error.
---
opends/resource/bin/start-ds | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/opends/resource/bin/start-ds b/opends/resource/bin/start-ds
index 9921cd0..0a4578d 100755
--- a/opends/resource/bin/start-ds
+++ b/opends/resource/bin/start-ds
@@ -23,7 +23,7 @@
# CDDL HEADER END
#
#
-# Portions Copyright 2006 Sun Microsystems, Inc.
+# Portions Copyright 2006-2007 Sun Microsystems, Inc.
# Capture the current working directory so that we can change to it later.
@@ -104,6 +104,22 @@
export SCRIPT_NAME_ARG
+# See if the provided set of arguments were sufficient for us to be able to
+# start the server or perform the requested operation. An exit code of 99
+# means that it should be possible to start the server. An exit code of 98
+# 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.
+${JAVA_BIN} ${SCRIPT_NAME_ARG} org.opends.server.core.DirectoryServer \
+ --configClass org.opends.server.extensions.ConfigFileHandler \
+ --configFile "${CONFIG_FILE}" --checkStartability "${@}"
+EC=${?}
+if test ${EC} -ne 99
+then
+ exit ${EC}
+fi
+
+
# 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.
--
Gitblit v1.10.0