From 7133dad37e38750796afdab4f26200a824c28391 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).

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

diff --git a/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java b/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
index 09daf56..ad381d4 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
+++ b/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