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

Ludovic Poitou
08.03.2011 8bbba9d3256c37205f9bd5ab131554c0fa453145
Add support for SVR4 packages for OpenDJ. Package name is opendj. It's a single package and has integration with SMF.
Default installation is /usr/opendj.
Once packages are installed, root must run configure to setup the Instance location (/var/opendj) and owner.
And the owner must run setup.

11 files modified
82 ■■■■■ changed files
opends/build.xml 2 ●●● patch | view | raw | blame | history
opends/resource/bin/_script-util.sh 6 ●●●● patch | view | raw | blame | history
opends/resource/bin/start-ds 11 ●●●● patch | view | raw | blame | history
opends/resource/bin/stop-ds 15 ●●●● patch | view | raw | blame | history
opends/resource/configure 13 ●●●● patch | view | raw | blame | history
opends/resource/unconfigure 11 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/Installation.java 9 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java 6 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/configurator/CheckInstance.java 3 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/configurator/Configurator.java 3 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/configurator/Unconfigurator.java 3 ●●●● patch | view | raw | blame | history
opends/build.xml
@@ -2594,7 +2594,7 @@
    </javac>
  </target>
  <!-- import file="build-svr4.xml"/ -->
  <import file="build-svr4.xml"/>
  <!-- Copy NDB Backend dependencies to build lib directory -->
  <target name="copyndbdeps" if="ismysqldirpresent"
opends/resource/bin/_script-util.sh
@@ -24,7 +24,7 @@
#
#
#      Copyright 2008-2010 Sun Microsystems, Inc.
#      Portions Copyright 2010 ForgeRock AS
#      Portions Copyright 2010-2011 ForgeRock AS
#
# Display an error message
@@ -261,7 +261,7 @@
then
  if [ -f "${INSTALL_ROOT}/configure" ]
  then
    if [ -f /etc/opends/instance.loc ]
    if [ -f /etc/opendj/instance.loc ]
    then
      if [ "${SCRIPT_NAME}" = "configure" ]
      then
@@ -272,7 +272,7 @@
          exit 0
    fi
      fi
      read INSTANCE_ROOT <  /etc/opends/instance.loc
      read INSTANCE_ROOT <  /etc/opendj/instance.loc
    else
      if [ "${SCRIPT_NAME}" != "configure" ]
      then
opends/resource/bin/start-ds
@@ -24,6 +24,7 @@
#
#
#      Copyright 2006-2009 Sun Microsystems, Inc.
#      Portions Copyright 2011 ForgeRock AS
# Capture the current working directory so that we can change to it later.
@@ -45,12 +46,12 @@
SCRIPT_NAME="start-ds"
export SCRIPT_NAME
# check for presence of lib/_svc-opends.sh file
# check for presence of lib/_svc-opendj.sh file
# If present, we should be on Solaris/OpenSolaris and use SMF to start
# OpenDS.
# Check --exec. If not present, start OpenDS from SMF
# OpenDJ.
# Check --exec. If not present, start OpenDJ from SMF
if test -f "${INSTALL_ROOT}/lib/_svc-opends.sh"
if test -f "${INSTALL_ROOT}/lib/_svc-opendj.sh"
then
    if [ "$1" = "--exec" ]
    then
@@ -61,7 +62,7 @@
    then
# these options are only used when trying to start the server
# In this case, start it through the service.
        exec /usr/sbin/svcadm enable -t svc:/network/ldap/server:opends
        exec /usr/sbin/svcadm enable -t svc:/network/ldap/server:opendj
    fi
fi
opends/resource/bin/stop-ds
@@ -24,6 +24,7 @@
#
#
#      Copyright 2006-2009 Sun Microsystems, Inc.
#      Portions Copyright 2011 ForgeRock AS
# This script may be used to request that the Directory Server shut down.
@@ -59,11 +60,11 @@
SCRIPT_NAME="stop-ds"
export SCRIPT_NAME
# check for presence of lib/_svc-opends.sh file
# check for presence of lib/_svc-opendj.sh file
# If present, we should be on Solaris/OpenSolaris and use SMF to start
# OpenDS.
# Check --exec. If not present, start OpenDS from SMF
if test -f "${INSTALL_ROOT}/lib/_svc-opends.sh"
# OpenDJ.
# Check --exec. If not present, start OpenDJ from SMF
if test -f "${INSTALL_ROOT}/lib/_svc-opendj.sh"
then
    if [ "$1" = "--exec" ]
    then
@@ -74,15 +75,15 @@
    then
        if [ "$1" = "-R" -o "$1" = "--restart" ]
        then
            /usr/sbin/svcadm disable -t svc:/network/ldap/server:opends
            /usr/sbin/svcadm disable -t svc:/network/ldap/server:opendj
            RETURN_CODE=$?
            if test ${RETURN_CODE} -ne 0
            then
                exit ${RETURN_CODE}
            fi
            exec /usr/sbin/svcadm enable -t svc:/network/ldap/server:opends
            exec /usr/sbin/svcadm enable -t svc:/network/ldap/server:opendj
        else
            exec /usr/sbin/svcadm disable -t svc:/network/ldap/server:opends
            exec /usr/sbin/svcadm disable -t svc:/network/ldap/server:opendj
        fi
    fi
fi
opends/resource/configure
@@ -24,6 +24,7 @@
#
#
#      Copyright 2006-2008 Sun Microsystems, Inc.
#      Portions Copyright 2011 ForgeRock AS
# Capture the current working directory so that we can change to it later.
@@ -70,7 +71,7 @@
  if test ${RETURN_CODE} -eq 0
  then
    # Retrieve INSTANCE_ROOT
    INSTANCE_ROOT=`cat /etc/opends/instance.loc`
    INSTANCE_ROOT=`cat /etc/opendj/instance.loc`
    # Now update SMF manifest, cp it to the right place and import it
    OWNER=`ls -ld ${INSTANCE_ROOT}`
    CURRENT_IFS=${IFS}
@@ -81,13 +82,13 @@
    IFS=${CURRENT_IFS}
    if test "${USERNAME}" = "ldap" -a "$GROUPNAME" = "ldap"
    then
        cp ${INSTALL_ROOT}/resources/opends-manifest.xml /var/svc/manifest/network/ldap/
        cp ${INSTALL_ROOT}/resources/opendj-manifest.xml /var/svc/manifest/network/ldap/
    else
        cat ${INSTALL_ROOT}/resources/opends-manifest.xml | sed -e "s/user='ldap/user='${USERNAME}/;s/group='ldap/group='${GROUPNAME}/" > /tmp/opends-manifest.$$
        cp /tmp/opends-manifest.$$ /var/svc/manifest/network/ldap/opends-manifest.xml
        rm /tmp/opends-manifest.$$
        cat ${INSTALL_ROOT}/resources/opendj-manifest.xml | sed -e "s/user='ldap/user='${USERNAME}/;s/group='ldap/group='${GROUPNAME}/" > /tmp/opendj-manifest.$$
        cp /tmp/opendj-manifest.$$ /var/svc/manifest/network/ldap/opendj-manifest.xml
        rm /tmp/opendj-manifest.$$
    fi
    /usr/sbin/svccfg import /var/svc/manifest/network/ldap/opends-manifest.xml
    /usr/sbin/svccfg import /var/svc/manifest/network/ldap/opendj-manifest.xml
  fi
  exit ${RETURN_CODE}
fi
opends/resource/unconfigure
@@ -24,6 +24,7 @@
#
#
#      Copyright 2008-2009 Sun Microsystems, Inc.
#      Portions Copyright 2011 ForgeRock AS
# Capture the current working directory so that we can change to it later.
@@ -98,11 +99,11 @@
echo "Disabling SMF service ..."
# Now update SMF manifest, delete it and remove the file from  /var/svc/manifest
echo select network/ldap/server >  /tmp/opends-unconfigure.$$
echo delete opends >> /tmp/opends-unconfigure.$$
/usr/sbin/svccfg -f /tmp/opends-unconfigure.$$
rm /tmp/opends-unconfigure.$$
rm /var/svc/manifest/network/ldap/opends-manifest.xml
echo select network/ldap/server >  /tmp/opendj-unconfigure.$$
echo delete opendj >> /tmp/opendj-unconfigure.$$
/usr/sbin/svccfg -f /tmp/opendj-unconfigure.$$
rm /tmp/opendj-unconfigure.$$
rm /var/svc/manifest/network/ldap/opendj-manifest.xml
echo "Resetting instance location ..."
# Launch the unconfigure process.
opends/src/quicksetup/org/opends/quicksetup/Installation.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 */
package org.opends.quicksetup;
@@ -50,10 +51,10 @@
public class Installation {
  /**
   * Relative path to OpenDS jar files.
   * Relative path to OpenDJ jar files.
   */
  public static final String[] OPEN_DS_JAR_RELATIVE_PATHS =
          {"lib/quicksetup.jar", "lib/OpenDS.jar", "lib/je.jar"};
          {"lib/quicksetup.jar", "lib/OpenDJ.jar", "lib/je.jar"};
  /**
   * The relative path where all the Windows binaries (batch files) are.
@@ -156,7 +157,7 @@
  /**
   * The path to the default instance.
   */
  public static final String DEFAULT_INSTANCE_PATH = "/var/opends";
  public static final String DEFAULT_INSTANCE_PATH = "/var/opendj";
  /**
   * The relative path to the instance.loc file.
@@ -167,7 +168,7 @@
  /**
   * The path to the instance.loc file.
   */
  public static final String INSTANCE_LOCATION_PATH = "/etc/opends/" +
  public static final String INSTANCE_LOCATION_PATH = "/etc/opendj/" +
    INSTANCE_LOCATION_PATH_RELATIVE;
  /**
opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 */
package org.opends.quicksetup.installer;
@@ -1129,6 +1130,8 @@
  /**
   * Writes the set-java-home file that is used by the scripts to set the
   * java home and the java arguments.
   * Since the set-java-home file is created and may be changed,
   * it's created under the instancePath.
   * @param installPath the install path of the server.
   * @param javaHome the java home to be used.
   * @param arguments a Map containing as key the name of the script and as
@@ -1169,7 +1172,8 @@
    writer.close();
    String destinationFile;
    String libDir = Utils.getPath(installPath,
    String libDir = Utils.getPath(Utils
        .getInstancePathFromInstallPath(installPath),
        Installation.LIBRARIES_PATH_RELATIVE);
    if (Utils.isWindows())
    {
opends/src/server/org/opends/server/tools/configurator/CheckInstance.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 */
package org.opends.server.tools.configurator;
@@ -62,7 +63,7 @@
          CheckInstance.class.getName());
  /** Prefix for log files. */
  static public final String LOG_FILE_PREFIX = "opends-checkinstance-";
  static public final String LOG_FILE_PREFIX = "opendj-checkinstance-";
  private static String installRootFromSystem;
  private static String instanceRootFromSystem;
opends/src/server/org/opends/server/tools/configurator/Configurator.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 */
package org.opends.server.tools.configurator;
@@ -60,7 +61,7 @@
    Configurator.class.getName());
  /** Prefix for log files. */
  static public final String LOG_FILE_PREFIX = "opends-configure-";
  static public final String LOG_FILE_PREFIX = "opendj-configure-";
  private String installRootFromSystem;
opends/src/server/org/opends/server/tools/configurator/Unconfigurator.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 */
package org.opends.server.tools.configurator;
@@ -56,7 +57,7 @@
    Unconfigurator.class.getName());
  /** Prefix for log files. */
  static public final String LOG_FILE_PREFIX = "opends-unconfigure-";
  static public final String LOG_FILE_PREFIX = "opendj-unconfigure-";
  private String installRootFromSystem;