2976N/A# The contents of this file are subject to the terms of the 2976N/A# Common Development and Distribution License, Version 1.0 only 2976N/A# (the "License"). You may not use this file except in compliance 2976N/A# You can obtain a copy of the license at 2976N/A# See the License for the specific language governing permissions 2976N/A# and limitations under the License. 2976N/A# When distributing Covered Code, include this CDDL HEADER in each 2976N/A# file and include the License file at 2976N/A# add the following below this CDDL HEADER, with the fields enclosed 2976N/A# by brackets "[]" replaced with your own identifying information: 2976N/A# Portions Copyright [yyyy] [name of copyright owner] 5022N/A# Copyright 2008-2010 Sun Microsystems, Inc. 6331N/A# Portions Copyright 2010-2011 ForgeRock AS 6331N/A# Portions Copyright 2013 Jens Elkner 6331N/A# Fallback to use on non-SunOS 6331N/APlease set OPENDJ_JAVA_HOME to the root of a Java 6 update 10 (or higher) 6331N/Ascript to specify the Java version to be used.' 6331N/A# function that tests the JAVA_HOME env variable. 6331N/A# function that tests the JAVA_BIN env variable. 6331N/A# function that tests the java executable in the PATH env variable. 5636N/A# function that tests the OPENDJ_JAVA_HOME env variable. 5636N/A# function that tests the OPENDJ_JAVA_BIN env variable. 2976N/A# function that sets the java home 4243N/A# Determine whether the detected Java environment is acceptable for use. 6331N/A # this call just tests the java version compatibility (for now: If the 6331N/A # JVM vendor is "Sun Microsystems Inc.", than JVM version string must be 6331N/A # lexicographically greater or equal to 1.6.0_10. Otherwise it is 6331N/A # assumed, that the JVM is compatible) and known args. 6331N/A # This is a particular error code that means that the Java version 6331N/A # is not supported. Let InstallDS to display the localized error msg 6331N/A # the error message includes the "Usage info" - so strip off the bloat 6331N/A print -u2 "Argument parse error(s):${ERRMSG##*arguments:}" 6331N/A print -u2 'To fix this problem, check your OPENDJ_JAVA_ARGS' \ 6331N/A 'environment variable (if explicitly set), check your' \ 6331N/A # Since no other tests are done, this must be a JVM error. 6331N/A print -u2 'The following Java invocation error occured:\n' "${ERRMSG}" 6331N/A print -u2 'OPENDJ_JAVA_ARGS=' "${OPENDJ_JAVA_ARGS}" 6331N/A 1. Delete the following file if it exists: 6331N/A 2. Check the Java properties file for correct *.java-home and *.java-args 6331N/A 3. Run the following command-line tool to persist the changes made: 6331N/A 4. When you run an OpenDJ tool, make sure, that OPENDJ_* environment 6331N/A variables are not already set.' 2976N/A# Explicitly set the PATH, LD_LIBRARY_PATH, LD_PRELOAD, and other important 2976N/A# system environment variables for security and compatibility reasons. 6331N/A # first unset everything we definitely do not need 6331N/A typeset KEEP=' COLUMNS DBUS_SESSION_BUS_ADDRESS DEFAULT_INSTANCE_DIR DEFAULT_SMF_FMRI DISPLAY FNLIST FNTRACE HOME HOST INSTALL_ROOT INSTANCE_ROOT JAVA_BIN JAVA_HOME KSH_VERSION LANG LC_COLLATE LC_CTYPE LC_MESSAGES LC_TIME LD_PRELOAD LD_PRELOAD_32 LD_PRELOAD_64 LINENO LINES LOGNAME MISC_ARGS NLSPATH OLD_SCRIPT_NAME OPENDJ_INVOKE_CLASS OPENDJ_JAVA_ARGS OPENDJ_JAVA_BIN OPENDJ_JAVA_HOME OPTIND ORIGINAL_JAVA_ARGS ORIGINAL_JAVA_BIN ORIGINAL_JAVA_HOME PATH PPID PS1 PS2 PS3 PS4 PWD RANDOM REMOTEHOST SCRIPT_ARGS SCRIPT_NAME SCRIPT_NAME_ARG SCRIPT_UTIL_CMD SECONDS SESSION_MANAGER SHELL SHLVL SMF_FMRI SSH_AGENT_PID SSH_AUTH_SOCK TERM TMOUT TMPDIR TZ USER USERNAME XAUTHORITY XDG_DATA_DIRS XDG_SESSION_COOKIE _AST_FEATURES _ VAR KEEP PWD ' 6331N/A# LD_LIBRARY_PATH='' LD_LIBRARY_PATH_32='' LD_LIBRARY_PATH_64='' \ 6331N/A# LD_PRELOAD LD_PRELOAD_32 LD_PRELOAD_64 2976N/A# Configure the appropriate CLASSPATH. 6331N/A '-V'|'--version'|'-?'|'-H'|'--help'|'-F'|'--fullversion') return 0;; 6331N/A # remove space escaping backslashes 6331N/A # Actually this should never happen, however, sometimes people are 6331N/AIt should point to the OpenDJ data directory for this service instance. 6331N/A svccfg -s '"${SMF_FMRI}"' refresh 6331N/A# Try to give the user a hint. Actually this should be done by the 6331N/A# Or if one wants check for populated instances, only. 6331N/AIt seems, that the following service has not yet been initialized: 6331N/APlease run' "${INSTALL_ROOT}/setup" '.\n' 6331N/Aseems to contain no valid data. If you want to use a different instance data 6331N/Adirectory, set your INSTANCE_ROOT environment variable to the appropriate 6331N/Apath. Otherwise, to initialize the shown directory shown above, run 6331N/A'"${INSTALL_ROOT}/setup"' .\n' 6331N/A # Capture the location of this script so that we can use them to create 6331N/A print -u2 "\nWARNING: ${SCRIPT_NAME} should not be run as user 'root'!\n" 6331N/A # If no SMF_FMRI is set (interactive use), we choose the default instance. 6331N/A 'set-full-environment-and-test-java') 6331N/A # No check for --version or --help option 6331N/A# list all defined script functions known at this point 6331N/A# If set to 'ALL', trace all functions, otherwise trace only the functions whose 6331N/A# name is in this comma or whitespace separated list