mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
26.37.2007 bc51a655469893084889271eb34e42bb25831c42
Fix intended for issue 1432 (install fails to start opends).

The modifications only impact Windows when the service is configured. We must call net start and net stop even when the server is already running (or already stopped) to be sure that opends_service.exe is handled properly.
2 files modified
32 ■■■■ changed files
opends/src/server/org/opends/server/core/DirectoryServer.java 13 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/StopDS.java 19 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -8814,14 +8814,21 @@
      isServerRunning = true;
    }
    boolean configuredAsService = isRunningAsWindowsService();
    if (isServerRunning)
    {
      returnValue = SERVER_ALREADY_STARTED;
      if (configuredAsService && !windowsNetStartPresent)
      {
        returnValue = START_AS_WINDOWS_SERVICE;
      }
      else
      {
        returnValue = SERVER_ALREADY_STARTED;
      }
    }
    else
    {
      boolean configuredAsService = isRunningAsWindowsService();
      if (configuredAsService)
      {
        if (noDetachPresent)
opends/src/server/org/opends/server/tools/StopDS.java
@@ -823,9 +823,23 @@
        isServerRunning = true;
      }
      boolean configuredAsService =
          DirectoryServer.isRunningAsWindowsService();
      if (!isServerRunning)
      {
        if (restartPresent)
        if (configuredAsService && !windowsNetStopPresent)
        {
          if (restartPresent)
          {
            returnValue = RESTART_AS_WINDOW_SERVICE;
          }
          else
          {
            returnValue = STOP_AS_WINDOW_SERVICE;
          }
        }
        else if (restartPresent)
        {
          returnValue = START_SERVER;
        }
@@ -836,9 +850,6 @@
      }
      else
      {
        boolean configuredAsService =
          DirectoryServer.isRunningAsWindowsService();
        if (configuredAsService)
        {
          if (windowsNetStopPresent)