From bbadcb75d4629441e73ea04782ae2c5decf64fe3 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 17 Dec 2007 10:43:53 +0000
Subject: [PATCH] 2730: New - The setup command should perform some basic memory tuning Note: this issue is not fully covered by the proposed modifications but all that is missing in order to fix it is to figure out which are the default memory values that we want to propose in the setup.

---
 opends/src/server/org/opends/server/tools/InstallDS.java |   39 +++++++++------------------------------
 1 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/opends/src/server/org/opends/server/tools/InstallDS.java b/opends/src/server/org/opends/server/tools/InstallDS.java
index 2c5c2e1..498de27 100644
--- a/opends/src/server/org/opends/server/tools/InstallDS.java
+++ b/opends/src/server/org/opends/server/tools/InstallDS.java
@@ -85,7 +85,7 @@
  *   <LI>Ask the user if they want to start the server when done installing</LI>
  * </UL>
  */
-public class InstallDS  extends ConsoleApplication
+public class InstallDS extends ConsoleApplication
 {
   private PlainTextProgressMessageFormatter formatter =
     new PlainTextProgressMessageFormatter();
@@ -160,7 +160,7 @@
   private InstallDSArgumentParser argParser;
 
   /**
-   * Constructor for the SetupCli object.
+   * Constructor for the InstallDS object.
    *
    * @param out the print stream to use for standard output.
    * @param err the print stream to use for standard error.
@@ -172,7 +172,7 @@
   }
 
   /**
-   * The main method for the setup CLI tool.
+   * The main method for the InstallDS CLI tool.
    *
    * @param args the command-line arguments provided to this program.
    */
@@ -242,7 +242,8 @@
 
     try {
       QuickSetupLog.initLogFileHandler(
-              File.createTempFile(LOG_FILE_PREFIX, LOG_FILE_SUFFIX),
+              QuickSetupLog.isInitialized() ? null :
+                File.createTempFile(LOG_FILE_PREFIX, LOG_FILE_SUFFIX),
               "org.opends.server.tools");
       QuickSetupLog.disableConsoleLogging();
     } catch (Throwable t) {
@@ -262,7 +263,7 @@
    * @param args the command-line arguments provided to this program.
    * @param  initializeServer  Indicates whether to initialize the server.
    *
-   * @return the return code (SUCCESSFUL, USER_DATA_ERROR or BUG.
+   * @return the return code (SUCCESSFUL, USER_DATA_ERROR or BUG).
    */
   public int execute(String[] args, boolean initializeServer)
   {
@@ -294,35 +295,13 @@
       return ErrorReturnCode.ERROR_USER_DATA.getReturnCode();
     }
 
-    // If we are on test only mode, try to see if the contents of the
-    // set-java-home file are valid.  If they are not try to update them, if no
-    // problem occurred while doing this delete the log file that does not
-    // contain any information.  The test only mode is called several times by
-    // the setup script and if we do not remove it we have a lot of empty log
-    // files.
+    // Delete the log file that does not contain any information.  The test only
+    // mode is called several times by the setup script and if we do not remove
+    // it we have a lot of empty log files.
     if (argParser.testOnlyArg.isPresent())
     {
       try
       {
-        String serverRoot = Utils.getInstallPathFromClasspath();
-        String javaHome = SetupUtils.getOpenDSJavaHome(serverRoot);
-        boolean writeJavaHome = false;
-        if (javaHome != null)
-        {
-          File f = new File(javaHome);
-          if (!f.exists())
-          {
-            writeJavaHome = true;
-          }
-        }
-        else
-        {
-          writeJavaHome = true;
-        }
-        if (writeJavaHome)
-        {
-          SetupUtils.writeSetOpenDSJavaHome(serverRoot, true);
-        }
         QuickSetupLog.getLogFile().deleteOnExit();
       }
       catch (Throwable t)

--
Gitblit v1.10.0