From 156826110630a6de143382854c7fa5b17d44693f Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 12 Mar 2007 16:46:40 +0000
Subject: [PATCH] Initialize the locks properties with the installation path found using the classpath.  This is required when the user.dir variable of the JVM used to launch setup does not match the installation path.  This is what happens for example when the setup is launched using an external tool (like Abbot).

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
index 09daf56..ad381d4 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
@@ -68,6 +68,8 @@
 
   private String ldapsUrl;
 
+  private static boolean lockPathInitialized;
+
   /**
    * The constructor of a CurrentInstallStatus object.
    *
@@ -222,6 +224,16 @@
   public static boolean isServerRunning()
   {
     boolean isServerRunning;
+    if (!lockPathInitialized)
+    {
+      String lockDirectory = Utils.getPath(Utils.getInstallPathFromClasspath(),
+      org.opends.server.util.ServerConstants.LOCKS_DIRECTORY);
+
+      System.setProperty(
+        org.opends.server.util.ServerConstants.PROPERTY_LOCK_DIRECTORY,
+        lockDirectory);
+      lockPathInitialized = true;
+    }
     String lockFile =
       org.opends.server.core.LockFileManager.getServerLockFileName();
     StringBuilder failureReason = new StringBuilder();

--
Gitblit v1.10.0