Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 097B1200BD8 for ; Wed, 7 Dec 2016 13:48:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 08325160AFD; Wed, 7 Dec 2016 12:48:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8F107160B26 for ; Wed, 7 Dec 2016 13:47:59 +0100 (CET) Received: (qmail 47030 invoked by uid 500); 7 Dec 2016 12:47:58 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 46954 invoked by uid 99); 7 Dec 2016 12:47:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2016 12:47:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8E8092C03DE for ; Wed, 7 Dec 2016 12:47:58 +0000 (UTC) Date: Wed, 7 Dec 2016 12:47:58 +0000 (UTC) From: "Guillaume Nodet (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (KARAF-4815) karaf script fail to locate KARAF_HOME. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 07 Dec 2016 12:48:01 -0000 [ https://issues.apache.org/jira/browse/KARAF-4815?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Guillaume Nodet updated KARAF-4815: ----------------------------------- Description:=20 karaf script fail to locate KARAF_HOME. on RedHat=20 REALNAME=3D`readlink -e "$0" > /dev/null 2>&1` return a blanc string and DIRNAME=3D`dirname "$REALNAME"` return a dot. on a side note, I suggest using $(shell comand) instead of `shell command` I've found a solution {code} #!/bin/sh # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.= 0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implie= d. # See the License for the specific language governing permissions and # limitations under the License. # ## FIX PATH Problem REALNAME=3D$(readlink -e "$0") > /dev/null 2>&1 if [ $? !=3D 0 ]; then REALNAME=3D$0 fi DIRNAME=3D$(dirname "$REALNAME") PROGNAME=3D$(basename "$REALNAME") # # Sourcing environment settings for karaf similar to tomcats setenv # KARAF_SCRIPT=3D"karaf" export KARAF_SCRIPT if [ -f "$DIRNAME/setenv" ]; then . "$DIRNAME/setenv" fi # # Set up some easily accessible MIN/MAX params for JVM mem usage # if [ "x$JAVA_MIN_MEM" =3D "x" ]; then JAVA_MIN_MEM=3D128M export JAVA_MIN_MEM fi if [ "x$JAVA_MAX_MEM" =3D "x" ]; then JAVA_MAX_MEM=3D512M export JAVA_MAX_MEM fi # # Check the mode that initiated the script # if [ "x$1" !=3D "x" ]; then MODE=3D$1 fi warn() { echo "${PROGNAME}: $*" } die() { warn "$*" exit 1 } detectOS() { # OS specific support (must be 'true' or 'false'). cygwin=3Dfalse; darwin=3Dfalse; aix=3Dfalse; os400=3Dfalse; case "$(uname)" in CYGWIN*) cygwin=3Dtrue ;; Darwin*) darwin=3Dtrue ;; AIX*) aix=3Dtrue ;; OS400*) os400=3Dtrue ;; esac # For AIX, set an environment variable if $aix; then export LDR_CNTRL=3DMAXDATA=3D0xB0000000@DSA echo $LDR_CNTRL fi } unlimitFD() { # Use the maximum available, or set MAX_FD !=3D -1 to use that if [ "x$MAX_FD" =3D "x" ]; then MAX_FD=3D"maximum" fi # Increase the maximum file descriptors if we can if [ "$os400" =3D "false" ] && [ "$cygwin" =3D "false" ]; then if [ "$MAX_FD" =3D "maximum" -o "$MAX_FD" =3D "max" ]; then MAX_FD_LIMIT=3D$(ulimit -H -n) if [ $? -eq 0 ]; then # use the system max MAX_FD=3D"$MAX_FD_LIMIT" else warn "Could not query system maximum file descriptor limit:= $MAX_FD_LIMIT" fi fi if [ "$MAX_FD" !=3D 'unlimited' ]; then ulimit -n $MAX_FD > /dev/null if [ $? -ne 0 ]; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi fi fi } locateHome() { if [ "x$KARAF_HOME" =3D "x" ]; then # In POSIX shells, CDPATH may cause cd to write to stdout (unset CDPATH) >/dev/null 2>&1 && unset CDPATH KARAF_HOME=3D$(cd "$DIRNAME/.."; pwd) fi if [ ! -d "$KARAF_HOME" ]; then die "KARAF_HOME is not valid: $KARAF_HOME" fi } locateBase() { if [ "x$KARAF_BASE" !=3D "x" ]; then if [ ! -d "$KARAF_BASE" ]; then die "KARAF_BASE is not valid: $KARAF_BASE" fi else KARAF_BASE=3D$KARAF_HOME fi } locateData() { if [ "x$KARAF_DATA" !=3D "x" ]; then if [ ! -d "$KARAF_DATA" ]; then die "KARAF_DATA is not valid: $KARAF_DATA" fi else KARAF_DATA=3D$KARAF_BASE/data fi } locateEtc() { if [ "x$KARAF_ETC" !=3D "x" ]; then if [ ! -d "$KARAF_ETC" ]; then die "KARAF_ETC is not valid: $KARAF_ETC" fi else KARAF_ETC=3D$KARAF_BASE/etc fi } setupNativePath() { # Support for loading native libraries LD_LIBRARY_PATH=3D"${LD_LIBRARY_PATH}:$KARAF_BASE/lib:$KARAF_HOME/lib" # For Cygwin, set PATH from LD_LIBRARY_PATH if $cygwin; then LD_LIBRARY_PATH=3D$(cygpath --path --windows "$LD_LIBRARY_PATH") PATH=3D"$PATH;$LD_LIBRARY_PATH" export PATH fi export LD_LIBRARY_PATH } pathCanonical() { dst=3D"${1}" while [ -h "${dst}" ] ; do ls=3D$(ls -ld "${dst}") link=3D$(expr "$ls" : '.*-> \(.*\)$') if expr "$link" : '/.*' > /dev/null; then dst=3D"$link" else dst=3D"$(dirname "${dst}")/$link" fi done bas=3D$(basename "${dst}") dir=3D$(dirname "${dst}") if [ "$bas" !=3D "$dir" ]; then dst=3D"$(pathCanonical "$dir")/$bas" fi echo "${dst}" | sed -e 's#//#/#g' -e 's#/./#/#g' -e 's#/[^/]*/../#/#g' } locateJava() { # Setup the Java Virtual Machine if $cygwin ; then [ -n "$JAVA" ] && JAVA=3D$(cygpath --unix "$JAVA") [ -n "$JAVA_HOME" ] && JAVA_HOME=3D$(cygpath --unix "$JAVA_HOME") fi =09if [ "x$JAVA_HOME" =3D "x" ] && [ "$darwin" =3D "true" ]; then =09=09JAVA_HOME=3D"$(/usr/libexec/java_home -v 1.8)" =09fi if [ "x$JAVA" =3D "x" ] && [ -r /etc/gentoo-release ] ; then JAVA_HOME=3D$(java-config --jre-home) fi if [ "x$JAVA" =3D "x" ]; then if [ "x$JAVA_HOME" !=3D "x" ]; then if [ ! -d "$JAVA_HOME" ]; then die "JAVA_HOME is not valid: $JAVA_HOME" fi JAVA=3D"$JAVA_HOME/bin/java" else warn "JAVA_HOME not set; results may vary" JAVA=3D$(type java) JAVA=3D$(expr "$JAVA" : '.* \(/.*\)$') if [ "x$JAVA" =3D "x" ]; then die "java command not found" fi fi fi if [ "x$JAVA_HOME" =3D "x" ]; then JAVA_HOME=3D"$(dirname $(dirname $(pathCanonical "$JAVA")))" fi } detectJVM() { #echo "$($JAVA -version)" # This service should call $(java -version), # read stdout, and look for hints if $JAVA -version 2>&1 | grep "^IBM" ; then JVM_VENDOR=3D"IBM" # on OS/400, java -version does not contain IBM explicitly elif $os400; then JVM_VENDOR=3D"IBM" else JVM_VENDOR=3D"SUN" fi # echo "JVM vendor is $JVM_VENDOR" } checkJvmVersion() { # echo "$($JAVA -version)" VERSION=3D$($JAVA -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).*"' | a= wk '{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3)}' | s= ed -e 's;\.;;g') # echo $VERSION if [ "$VERSION" -lt "60" ]; then echo "JVM must be greater than 1.6" exit 1; fi } setupDebugOptions() { if [ "x$JAVA_OPTS" =3D "x" ]; then JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS" fi export JAVA_OPTS if [ "x$EXTRA_JAVA_OPTS" !=3D "x" ]; then JAVA_OPTS=3D"$JAVA_OPTS $EXTRA_JAVA_OPTS" fi # Set Debug options if enabled if [ "x$KARAF_DEBUG" !=3D "x" ]; then # Ignore DEBUG in case of stop, client, or status mode if [ "x$MODE" =3D "xstop" ]; then return fi if [ "x$MODE" =3D "xclient" ]; then return fi if [ "x$MODE" =3D "xstatus" ]; then return fi # Use the defaults if JAVA_DEBUG_OPTS was not set if [ "x$JAVA_DEBUG_OPTS" =3D "x" ]; then JAVA_DEBUG_OPTS=3D"$DEFAULT_JAVA_DEBUG_OPTS" fi JAVA_OPTS=3D"$JAVA_DEBUG_OPTS $JAVA_OPTS" warn "Enabling Java debug options: $JAVA_DEBUG_OPTS" fi } setupDefaults() { DEFAULT_JAVA_OPTS=3D"-Xms$JAVA_MIN_MEM -Xmx$JAVA_MAX_MEM -XX:+UnlockDia= gnosticVMOptions -XX:+UnsyncloadClass " #Set the JVM_VENDOR specific JVM flags if [ "$JVM_VENDOR" =3D "SUN" ]; then # permgen was removed in Java 8 VERSION=3D$($JAVA -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).*"= ' | awk '{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3)}= ' | sed -e 's;\.;;g') if [ "$VERSION" -lt "80" ]; then # Check some easily accessible MIN/MAX params for JVM mem usage if [ "x$JAVA_PERM_MEM" !=3D "x" ]; then DEFAULT_JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS -XX:PermSize=3D$JAV= A_PERM_MEM" fi if [ "x$JAVA_MAX_PERM_MEM" !=3D "x" ]; then DEFAULT_JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS -XX:MaxPermSize=3D$= JAVA_MAX_PERM_MEM" fi fi DEFAULT_JAVA_OPTS=3D"-server $DEFAULT_JAVA_OPTS -Dcom.sun.managemen= t.jmxremote" elif [ "$JVM_VENDOR" =3D "IBM" ]; then if $os400; then DEFAULT_JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS" elif $aix; then DEFAULT_JAVA_OPTS=3D"-Xverify:none -Xdump:heap -Xlp $DEFAULT_JA= VA_OPTS" else DEFAULT_JAVA_OPTS=3D"-Xverify:none $DEFAULT_JAVA_OPTS" fi fi # Add the jars in the lib dir for file in "$KARAF_HOME"/lib/karaf*.jar do if [ -z "$CLASSPATH" ]; then CLASSPATH=3D"$file" else CLASSPATH=3D"$CLASSPATH:$file" fi done DEFAULT_JAVA_DEBUG_PORT=3D"5005" if [ "x$JAVA_DEBUG_PORT" =3D "x" ]; then JAVA_DEBUG_PORT=3D"$DEFAULT_JAVA_DEBUG_PORT" fi DEFAULT_JAVA_DEBUG_OPTS=3D"-agentlib:jdwp=3Dtransport=3Ddt_socket,serve= r=3Dy,suspend=3Dn,address=3D$JAVA_DEBUG_PORT" ## ## TODO: Move to conf/profiler/yourkit.{sh|cmd} ## # Uncomment to enable YourKit profiling #DEFAULT_JAVA_DEBUG_OPTS=3D"-Xrunyjpagent" } init() { # Determine if there is special OS handling we must perform detectOS # Unlimit the number of file descriptors if possible unlimitFD # Locate the Karaf home directory locateHome # Locate the Karaf base directory locateBase # Locate the Karaf data directory locateData # Locate the Karaf etc directory locateEtc # Setup the native library path setupNativePath # Locate the Java VM to execute locateJava # Determine the JVM vendor detectJVM =20 # Determine the JVM version >=3D 1.6 checkJvmVersion # Setup default options setupDefaults # Install debug options setupDebugOptions } run() { OPTS=3D"-Dkaraf.startLocalConsole=3Dtrue -Dkaraf.startRemoteShell=3Dtru= e" MAIN=3Dorg.apache.karaf.main.Main while [ "$1" !=3D "" ]; do case $1 in 'clean') rm -Rf "$KARAF_DATA" shift ;; 'debug') if [ "x$JAVA_DEBUG_OPTS" =3D "x" ]; then JAVA_DEBUG_OPTS=3D"$DEFAULT_JAVA_DEBUG_OPTS" fi JAVA_OPTS=3D"$JAVA_DEBUG_OPTS $JAVA_OPTS" shift ;; 'status') MAIN=3Dorg.apache.karaf.main.Status shift ;; 'stop') MAIN=3Dorg.apache.karaf.main.Stop shift ;; 'console') shift ;; 'server') OPTS=3D"-Dkaraf.startLocalConsole=3Dfalse -Dkaraf.startRemo= teShell=3Dtrue" shift ;; 'client') OPTS=3D"-Dkaraf.startLocalConsole=3Dtrue -Dkaraf.startRemot= eShell=3Dfalse" shift ;; *) break ;; esac done JAVA_ENDORSED_DIRS=3D"${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/en= dorsed:${KARAF_HOME}/lib/endorsed" JAVA_EXT_DIRS=3D"${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARAF_= HOME}/lib/ext" if $cygwin; then KARAF_HOME=3D$(cygpath --path --windows "$KARAF_HOME") KARAF_BASE=3D$(cygpath --path --windows "$KARAF_BASE") KARAF_DATA=3D$(cygpath --path --windows "$KARAF_DATA") KARAF_ETC=3D$(cygpath --path --windows "$KARAF_ETC") if [ ! -z "$CLASSPATH" ]; then CLASSPATH=3D$(cygpath --path --windows "$CLASSPATH") fi JAVA_HOME=3D$(cygpath --path --windows "$JAVA_HOME") JAVA_ENDORSED_DIRS=3D$(cygpath --path --windows "$JAVA_ENDORSED_DIR= S") JAVA_EXT_DIRS=3D$(cygpath --path --windows "$JAVA_EXT_DIRS") fi cd "$KARAF_BASE" exec "$JAVA" $JAVA_OPTS -Djava.endorsed.dirs=3D"${JAVA_ENDORSED_DIRS}" = -Djava.ext.dirs=3D"${JAVA_EXT_DIRS}" -Dkaraf.instances=3D"${KARAF_HOME}/ins= tances" -Dkaraf.home=3D"$KARAF_HOME" -Dkaraf.base=3D"$KARAF_BASE" -Dkaraf.d= ata=3D"$KARAF_DATA" -Dkaraf.etc=3D"$KARAF_ETC" -Djava.io.tmpdir=3D"$KARAF_D= ATA/tmp" -Djava.util.logging.config.file=3D"$KARAF_BASE/etc/java.util.loggi= ng.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" $MAIN "$@" } main() { init run "$@" } main "$@" {code} was: karaf script fail to locate KARAF_HOME. on RedHat=20 REALNAME=3D`readlink -e "$0" > /dev/null 2>&1` return a blanc string and DIRNAME=3D`dirname "$REALNAME"` return a dot. on a side note, I suggest using $(shell comand) instead of `shell command` I've found a solution #!/bin/sh # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.= 0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implie= d. # See the License for the specific language governing permissions and # limitations under the License. # ## FIX PATH Problem REALNAME=3D$(readlink -e "$0") > /dev/null 2>&1 if [ $? !=3D 0 ]; then REALNAME=3D$0 fi DIRNAME=3D$(dirname "$REALNAME") PROGNAME=3D$(basename "$REALNAME") # # Sourcing environment settings for karaf similar to tomcats setenv # KARAF_SCRIPT=3D"karaf" export KARAF_SCRIPT if [ -f "$DIRNAME/setenv" ]; then . "$DIRNAME/setenv" fi # # Set up some easily accessible MIN/MAX params for JVM mem usage # if [ "x$JAVA_MIN_MEM" =3D "x" ]; then JAVA_MIN_MEM=3D128M export JAVA_MIN_MEM fi if [ "x$JAVA_MAX_MEM" =3D "x" ]; then JAVA_MAX_MEM=3D512M export JAVA_MAX_MEM fi # # Check the mode that initiated the script # if [ "x$1" !=3D "x" ]; then MODE=3D$1 fi warn() { echo "${PROGNAME}: $*" } die() { warn "$*" exit 1 } detectOS() { # OS specific support (must be 'true' or 'false'). cygwin=3Dfalse; darwin=3Dfalse; aix=3Dfalse; os400=3Dfalse; case "$(uname)" in CYGWIN*) cygwin=3Dtrue ;; Darwin*) darwin=3Dtrue ;; AIX*) aix=3Dtrue ;; OS400*) os400=3Dtrue ;; esac # For AIX, set an environment variable if $aix; then export LDR_CNTRL=3DMAXDATA=3D0xB0000000@DSA echo $LDR_CNTRL fi } unlimitFD() { # Use the maximum available, or set MAX_FD !=3D -1 to use that if [ "x$MAX_FD" =3D "x" ]; then MAX_FD=3D"maximum" fi # Increase the maximum file descriptors if we can if [ "$os400" =3D "false" ] && [ "$cygwin" =3D "false" ]; then if [ "$MAX_FD" =3D "maximum" -o "$MAX_FD" =3D "max" ]; then MAX_FD_LIMIT=3D$(ulimit -H -n) if [ $? -eq 0 ]; then # use the system max MAX_FD=3D"$MAX_FD_LIMIT" else warn "Could not query system maximum file descriptor limit:= $MAX_FD_LIMIT" fi fi if [ "$MAX_FD" !=3D 'unlimited' ]; then ulimit -n $MAX_FD > /dev/null if [ $? -ne 0 ]; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi fi fi } locateHome() { if [ "x$KARAF_HOME" =3D "x" ]; then # In POSIX shells, CDPATH may cause cd to write to stdout (unset CDPATH) >/dev/null 2>&1 && unset CDPATH KARAF_HOME=3D$(cd "$DIRNAME/.."; pwd) fi if [ ! -d "$KARAF_HOME" ]; then die "KARAF_HOME is not valid: $KARAF_HOME" fi } locateBase() { if [ "x$KARAF_BASE" !=3D "x" ]; then if [ ! -d "$KARAF_BASE" ]; then die "KARAF_BASE is not valid: $KARAF_BASE" fi else KARAF_BASE=3D$KARAF_HOME fi } locateData() { if [ "x$KARAF_DATA" !=3D "x" ]; then if [ ! -d "$KARAF_DATA" ]; then die "KARAF_DATA is not valid: $KARAF_DATA" fi else KARAF_DATA=3D$KARAF_BASE/data fi } locateEtc() { if [ "x$KARAF_ETC" !=3D "x" ]; then if [ ! -d "$KARAF_ETC" ]; then die "KARAF_ETC is not valid: $KARAF_ETC" fi else KARAF_ETC=3D$KARAF_BASE/etc fi } setupNativePath() { # Support for loading native libraries LD_LIBRARY_PATH=3D"${LD_LIBRARY_PATH}:$KARAF_BASE/lib:$KARAF_HOME/lib" # For Cygwin, set PATH from LD_LIBRARY_PATH if $cygwin; then LD_LIBRARY_PATH=3D$(cygpath --path --windows "$LD_LIBRARY_PATH") PATH=3D"$PATH;$LD_LIBRARY_PATH" export PATH fi export LD_LIBRARY_PATH } pathCanonical() { dst=3D"${1}" while [ -h "${dst}" ] ; do ls=3D$(ls -ld "${dst}") link=3D$(expr "$ls" : '.*-> \(.*\)$') if expr "$link" : '/.*' > /dev/null; then dst=3D"$link" else dst=3D"$(dirname "${dst}")/$link" fi done bas=3D$(basename "${dst}") dir=3D$(dirname "${dst}") if [ "$bas" !=3D "$dir" ]; then dst=3D"$(pathCanonical "$dir")/$bas" fi echo "${dst}" | sed -e 's#//#/#g' -e 's#/./#/#g' -e 's#/[^/]*/../#/#g' } locateJava() { # Setup the Java Virtual Machine if $cygwin ; then [ -n "$JAVA" ] && JAVA=3D$(cygpath --unix "$JAVA") [ -n "$JAVA_HOME" ] && JAVA_HOME=3D$(cygpath --unix "$JAVA_HOME") fi =09if [ "x$JAVA_HOME" =3D "x" ] && [ "$darwin" =3D "true" ]; then =09=09JAVA_HOME=3D"$(/usr/libexec/java_home -v 1.8)" =09fi if [ "x$JAVA" =3D "x" ] && [ -r /etc/gentoo-release ] ; then JAVA_HOME=3D$(java-config --jre-home) fi if [ "x$JAVA" =3D "x" ]; then if [ "x$JAVA_HOME" !=3D "x" ]; then if [ ! -d "$JAVA_HOME" ]; then die "JAVA_HOME is not valid: $JAVA_HOME" fi JAVA=3D"$JAVA_HOME/bin/java" else warn "JAVA_HOME not set; results may vary" JAVA=3D$(type java) JAVA=3D$(expr "$JAVA" : '.* \(/.*\)$') if [ "x$JAVA" =3D "x" ]; then die "java command not found" fi fi fi if [ "x$JAVA_HOME" =3D "x" ]; then JAVA_HOME=3D"$(dirname $(dirname $(pathCanonical "$JAVA")))" fi } detectJVM() { #echo "$($JAVA -version)" # This service should call $(java -version), # read stdout, and look for hints if $JAVA -version 2>&1 | grep "^IBM" ; then JVM_VENDOR=3D"IBM" # on OS/400, java -version does not contain IBM explicitly elif $os400; then JVM_VENDOR=3D"IBM" else JVM_VENDOR=3D"SUN" fi # echo "JVM vendor is $JVM_VENDOR" } checkJvmVersion() { # echo "$($JAVA -version)" VERSION=3D$($JAVA -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).*"' | a= wk '{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3)}' | s= ed -e 's;\.;;g') # echo $VERSION if [ "$VERSION" -lt "60" ]; then echo "JVM must be greater than 1.6" exit 1; fi } setupDebugOptions() { if [ "x$JAVA_OPTS" =3D "x" ]; then JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS" fi export JAVA_OPTS if [ "x$EXTRA_JAVA_OPTS" !=3D "x" ]; then JAVA_OPTS=3D"$JAVA_OPTS $EXTRA_JAVA_OPTS" fi # Set Debug options if enabled if [ "x$KARAF_DEBUG" !=3D "x" ]; then # Ignore DEBUG in case of stop, client, or status mode if [ "x$MODE" =3D "xstop" ]; then return fi if [ "x$MODE" =3D "xclient" ]; then return fi if [ "x$MODE" =3D "xstatus" ]; then return fi # Use the defaults if JAVA_DEBUG_OPTS was not set if [ "x$JAVA_DEBUG_OPTS" =3D "x" ]; then JAVA_DEBUG_OPTS=3D"$DEFAULT_JAVA_DEBUG_OPTS" fi JAVA_OPTS=3D"$JAVA_DEBUG_OPTS $JAVA_OPTS" warn "Enabling Java debug options: $JAVA_DEBUG_OPTS" fi } setupDefaults() { DEFAULT_JAVA_OPTS=3D"-Xms$JAVA_MIN_MEM -Xmx$JAVA_MAX_MEM -XX:+UnlockDia= gnosticVMOptions -XX:+UnsyncloadClass " #Set the JVM_VENDOR specific JVM flags if [ "$JVM_VENDOR" =3D "SUN" ]; then # permgen was removed in Java 8 VERSION=3D$($JAVA -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).*"= ' | awk '{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3)}= ' | sed -e 's;\.;;g') if [ "$VERSION" -lt "80" ]; then # Check some easily accessible MIN/MAX params for JVM mem usage if [ "x$JAVA_PERM_MEM" !=3D "x" ]; then DEFAULT_JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS -XX:PermSize=3D$JAV= A_PERM_MEM" fi if [ "x$JAVA_MAX_PERM_MEM" !=3D "x" ]; then DEFAULT_JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS -XX:MaxPermSize=3D$= JAVA_MAX_PERM_MEM" fi fi DEFAULT_JAVA_OPTS=3D"-server $DEFAULT_JAVA_OPTS -Dcom.sun.managemen= t.jmxremote" elif [ "$JVM_VENDOR" =3D "IBM" ]; then if $os400; then DEFAULT_JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS" elif $aix; then DEFAULT_JAVA_OPTS=3D"-Xverify:none -Xdump:heap -Xlp $DEFAULT_JA= VA_OPTS" else DEFAULT_JAVA_OPTS=3D"-Xverify:none $DEFAULT_JAVA_OPTS" fi fi # Add the jars in the lib dir for file in "$KARAF_HOME"/lib/karaf*.jar do if [ -z "$CLASSPATH" ]; then CLASSPATH=3D"$file" else CLASSPATH=3D"$CLASSPATH:$file" fi done DEFAULT_JAVA_DEBUG_PORT=3D"5005" if [ "x$JAVA_DEBUG_PORT" =3D "x" ]; then JAVA_DEBUG_PORT=3D"$DEFAULT_JAVA_DEBUG_PORT" fi DEFAULT_JAVA_DEBUG_OPTS=3D"-agentlib:jdwp=3Dtransport=3Ddt_socket,serve= r=3Dy,suspend=3Dn,address=3D$JAVA_DEBUG_PORT" ## ## TODO: Move to conf/profiler/yourkit.{sh|cmd} ## # Uncomment to enable YourKit profiling #DEFAULT_JAVA_DEBUG_OPTS=3D"-Xrunyjpagent" } init() { # Determine if there is special OS handling we must perform detectOS # Unlimit the number of file descriptors if possible unlimitFD # Locate the Karaf home directory locateHome # Locate the Karaf base directory locateBase # Locate the Karaf data directory locateData # Locate the Karaf etc directory locateEtc # Setup the native library path setupNativePath # Locate the Java VM to execute locateJava # Determine the JVM vendor detectJVM =20 # Determine the JVM version >=3D 1.6 checkJvmVersion # Setup default options setupDefaults # Install debug options setupDebugOptions } run() { OPTS=3D"-Dkaraf.startLocalConsole=3Dtrue -Dkaraf.startRemoteShell=3Dtru= e" MAIN=3Dorg.apache.karaf.main.Main while [ "$1" !=3D "" ]; do case $1 in 'clean') rm -Rf "$KARAF_DATA" shift ;; 'debug') if [ "x$JAVA_DEBUG_OPTS" =3D "x" ]; then JAVA_DEBUG_OPTS=3D"$DEFAULT_JAVA_DEBUG_OPTS" fi JAVA_OPTS=3D"$JAVA_DEBUG_OPTS $JAVA_OPTS" shift ;; 'status') MAIN=3Dorg.apache.karaf.main.Status shift ;; 'stop') MAIN=3Dorg.apache.karaf.main.Stop shift ;; 'console') shift ;; 'server') OPTS=3D"-Dkaraf.startLocalConsole=3Dfalse -Dkaraf.startRemo= teShell=3Dtrue" shift ;; 'client') OPTS=3D"-Dkaraf.startLocalConsole=3Dtrue -Dkaraf.startRemot= eShell=3Dfalse" shift ;; *) break ;; esac done JAVA_ENDORSED_DIRS=3D"${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/en= dorsed:${KARAF_HOME}/lib/endorsed" JAVA_EXT_DIRS=3D"${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARAF_= HOME}/lib/ext" if $cygwin; then KARAF_HOME=3D$(cygpath --path --windows "$KARAF_HOME") KARAF_BASE=3D$(cygpath --path --windows "$KARAF_BASE") KARAF_DATA=3D$(cygpath --path --windows "$KARAF_DATA") KARAF_ETC=3D$(cygpath --path --windows "$KARAF_ETC") if [ ! -z "$CLASSPATH" ]; then CLASSPATH=3D$(cygpath --path --windows "$CLASSPATH") fi JAVA_HOME=3D$(cygpath --path --windows "$JAVA_HOME") JAVA_ENDORSED_DIRS=3D$(cygpath --path --windows "$JAVA_ENDORSED_DIR= S") JAVA_EXT_DIRS=3D$(cygpath --path --windows "$JAVA_EXT_DIRS") fi cd "$KARAF_BASE" exec "$JAVA" $JAVA_OPTS -Djava.endorsed.dirs=3D"${JAVA_ENDORSED_DIRS}" = -Djava.ext.dirs=3D"${JAVA_EXT_DIRS}" -Dkaraf.instances=3D"${KARAF_HOME}/ins= tances" -Dkaraf.home=3D"$KARAF_HOME" -Dkaraf.base=3D"$KARAF_BASE" -Dkaraf.d= ata=3D"$KARAF_DATA" -Dkaraf.etc=3D"$KARAF_ETC" -Djava.io.tmpdir=3D"$KARAF_D= ATA/tmp" -Djava.util.logging.config.file=3D"$KARAF_BASE/etc/java.util.loggi= ng.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" $MAIN "$@" } main() { init run "$@" } main "$@" > karaf script fail to locate KARAF_HOME. > --------------------------------------- > > Key: KARAF-4815 > URL: https://issues.apache.org/jira/browse/KARAF-4815 > Project: Karaf > Issue Type: Bug > Affects Versions: 3.0.7 > Environment: Linux RedHat 2.6.32-573.18.1.el6.x86_64 #1 SMP Wed J= an 6 11:20:49 EST 2016 x86_64 x86_64 x86_64 GNU/Linux > Reporter: Terrien Jean-Yves > Assignee: Jean-Baptiste Onofr=C3=A9 > > karaf script fail to locate KARAF_HOME. > on RedHat=20 > REALNAME=3D`readlink -e "$0" > /dev/null 2>&1` return a blanc string > and DIRNAME=3D`dirname "$REALNAME"` return a dot. > on a side note, I suggest using $(shell comand) instead of `shell command= ` > I've found a solution > {code} > #!/bin/sh > # > # Licensed to the Apache Software Foundation (ASF) under one or more > # contributor license agreements. See the NOTICE file distributed wit= h > # this work for additional information regarding copyright ownership. > # The ASF licenses this file to You under the Apache License, Version = 2.0 > # (the "License"); you may not use this file except in compliance with > # the License. You may obtain a copy of the License at > # > # http://www.apache.org/licenses/LICENSE-2.0 > # > # Unless required by applicable law or agreed to in writing, software > # distributed under the License is distributed on an "AS IS" BASIS, > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impl= ied. > # See the License for the specific language governing permissions and > # limitations under the License. > # > ## FIX PATH Problem > REALNAME=3D$(readlink -e "$0") > /dev/null 2>&1 > if [ $? !=3D 0 ]; then > REALNAME=3D$0 > fi > DIRNAME=3D$(dirname "$REALNAME") > PROGNAME=3D$(basename "$REALNAME") > # > # Sourcing environment settings for karaf similar to tomcats setenv > # > KARAF_SCRIPT=3D"karaf" > export KARAF_SCRIPT > if [ -f "$DIRNAME/setenv" ]; then > . "$DIRNAME/setenv" > fi > # > # Set up some easily accessible MIN/MAX params for JVM mem usage > # > if [ "x$JAVA_MIN_MEM" =3D "x" ]; then > JAVA_MIN_MEM=3D128M > export JAVA_MIN_MEM > fi > if [ "x$JAVA_MAX_MEM" =3D "x" ]; then > JAVA_MAX_MEM=3D512M > export JAVA_MAX_MEM > fi > # > # Check the mode that initiated the script > # > if [ "x$1" !=3D "x" ]; then > MODE=3D$1 > fi > warn() { > echo "${PROGNAME}: $*" > } > die() { > warn "$*" > exit 1 > } > detectOS() { > # OS specific support (must be 'true' or 'false'). > cygwin=3Dfalse; > darwin=3Dfalse; > aix=3Dfalse; > os400=3Dfalse; > case "$(uname)" in > CYGWIN*) > cygwin=3Dtrue > ;; > Darwin*) > darwin=3Dtrue > ;; > AIX*) > aix=3Dtrue > ;; > OS400*) > os400=3Dtrue > ;; > esac > # For AIX, set an environment variable > if $aix; then > export LDR_CNTRL=3DMAXDATA=3D0xB0000000@DSA > echo $LDR_CNTRL > fi > } > unlimitFD() { > # Use the maximum available, or set MAX_FD !=3D -1 to use that > if [ "x$MAX_FD" =3D "x" ]; then > MAX_FD=3D"maximum" > fi > # Increase the maximum file descriptors if we can > if [ "$os400" =3D "false" ] && [ "$cygwin" =3D "false" ]; then > if [ "$MAX_FD" =3D "maximum" -o "$MAX_FD" =3D "max" ]; then > MAX_FD_LIMIT=3D$(ulimit -H -n) > if [ $? -eq 0 ]; then > # use the system max > MAX_FD=3D"$MAX_FD_LIMIT" > else > warn "Could not query system maximum file descriptor limi= t: $MAX_FD_LIMIT" > fi > fi > if [ "$MAX_FD" !=3D 'unlimited' ]; then > ulimit -n $MAX_FD > /dev/null > if [ $? -ne 0 ]; then > warn "Could not set maximum file descriptor limit: $MAX_F= D" > fi > fi > fi > } > locateHome() { > if [ "x$KARAF_HOME" =3D "x" ]; then > # In POSIX shells, CDPATH may cause cd to write to stdout > (unset CDPATH) >/dev/null 2>&1 && unset CDPATH > KARAF_HOME=3D$(cd "$DIRNAME/.."; pwd) > fi > if [ ! -d "$KARAF_HOME" ]; then > die "KARAF_HOME is not valid: $KARAF_HOME" > fi > } > locateBase() { > if [ "x$KARAF_BASE" !=3D "x" ]; then > if [ ! -d "$KARAF_BASE" ]; then > die "KARAF_BASE is not valid: $KARAF_BASE" > fi > else > KARAF_BASE=3D$KARAF_HOME > fi > } > locateData() { > if [ "x$KARAF_DATA" !=3D "x" ]; then > if [ ! -d "$KARAF_DATA" ]; then > die "KARAF_DATA is not valid: $KARAF_DATA" > fi > else > KARAF_DATA=3D$KARAF_BASE/data > fi > } > locateEtc() { > if [ "x$KARAF_ETC" !=3D "x" ]; then > if [ ! -d "$KARAF_ETC" ]; then > die "KARAF_ETC is not valid: $KARAF_ETC" > fi > else > KARAF_ETC=3D$KARAF_BASE/etc > fi > } > setupNativePath() { > # Support for loading native libraries > LD_LIBRARY_PATH=3D"${LD_LIBRARY_PATH}:$KARAF_BASE/lib:$KARAF_HOME/lib= " > # For Cygwin, set PATH from LD_LIBRARY_PATH > if $cygwin; then > LD_LIBRARY_PATH=3D$(cygpath --path --windows "$LD_LIBRARY_PATH") > PATH=3D"$PATH;$LD_LIBRARY_PATH" > export PATH > fi > export LD_LIBRARY_PATH > } > pathCanonical() { > dst=3D"${1}" > while [ -h "${dst}" ] ; do > ls=3D$(ls -ld "${dst}") > link=3D$(expr "$ls" : '.*-> \(.*\)$') > if expr "$link" : '/.*' > /dev/null; then > dst=3D"$link" > else > dst=3D"$(dirname "${dst}")/$link" > fi > done > bas=3D$(basename "${dst}") > dir=3D$(dirname "${dst}") > if [ "$bas" !=3D "$dir" ]; then > dst=3D"$(pathCanonical "$dir")/$bas" > fi > echo "${dst}" | sed -e 's#//#/#g' -e 's#/./#/#g' -e 's#/[^/]*/../#/#g= ' > } > locateJava() { > # Setup the Java Virtual Machine > if $cygwin ; then > [ -n "$JAVA" ] && JAVA=3D$(cygpath --unix "$JAVA") > [ -n "$JAVA_HOME" ] && JAVA_HOME=3D$(cygpath --unix "$JAVA_HOME") > fi > =09if [ "x$JAVA_HOME" =3D "x" ] && [ "$darwin" =3D "true" ]; then > =09=09JAVA_HOME=3D"$(/usr/libexec/java_home -v 1.8)" > =09fi > if [ "x$JAVA" =3D "x" ] && [ -r /etc/gentoo-release ] ; then > JAVA_HOME=3D$(java-config --jre-home) > fi > if [ "x$JAVA" =3D "x" ]; then > if [ "x$JAVA_HOME" !=3D "x" ]; then > if [ ! -d "$JAVA_HOME" ]; then > die "JAVA_HOME is not valid: $JAVA_HOME" > fi > JAVA=3D"$JAVA_HOME/bin/java" > else > warn "JAVA_HOME not set; results may vary" > JAVA=3D$(type java) > JAVA=3D$(expr "$JAVA" : '.* \(/.*\)$') > if [ "x$JAVA" =3D "x" ]; then > die "java command not found" > fi > fi > fi > if [ "x$JAVA_HOME" =3D "x" ]; then > JAVA_HOME=3D"$(dirname $(dirname $(pathCanonical "$JAVA")))" > fi > } > detectJVM() { > #echo "$($JAVA -version)" > # This service should call $(java -version), > # read stdout, and look for hints > if $JAVA -version 2>&1 | grep "^IBM" ; then > JVM_VENDOR=3D"IBM" > # on OS/400, java -version does not contain IBM explicitly > elif $os400; then > JVM_VENDOR=3D"IBM" > else > JVM_VENDOR=3D"SUN" > fi > # echo "JVM vendor is $JVM_VENDOR" > } > checkJvmVersion() { > # echo "$($JAVA -version)" > VERSION=3D$($JAVA -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).*"' |= awk '{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3)}' |= sed -e 's;\.;;g') > # echo $VERSION > if [ "$VERSION" -lt "60" ]; then > echo "JVM must be greater than 1.6" > exit 1; > fi > } > setupDebugOptions() { > if [ "x$JAVA_OPTS" =3D "x" ]; then > JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS" > fi > export JAVA_OPTS > if [ "x$EXTRA_JAVA_OPTS" !=3D "x" ]; then > JAVA_OPTS=3D"$JAVA_OPTS $EXTRA_JAVA_OPTS" > fi > # Set Debug options if enabled > if [ "x$KARAF_DEBUG" !=3D "x" ]; then > # Ignore DEBUG in case of stop, client, or status mode > if [ "x$MODE" =3D "xstop" ]; then > return > fi > if [ "x$MODE" =3D "xclient" ]; then > return > fi > if [ "x$MODE" =3D "xstatus" ]; then > return > fi > # Use the defaults if JAVA_DEBUG_OPTS was not set > if [ "x$JAVA_DEBUG_OPTS" =3D "x" ]; then > JAVA_DEBUG_OPTS=3D"$DEFAULT_JAVA_DEBUG_OPTS" > fi > JAVA_OPTS=3D"$JAVA_DEBUG_OPTS $JAVA_OPTS" > warn "Enabling Java debug options: $JAVA_DEBUG_OPTS" > fi > } > setupDefaults() { > DEFAULT_JAVA_OPTS=3D"-Xms$JAVA_MIN_MEM -Xmx$JAVA_MAX_MEM -XX:+UnlockD= iagnosticVMOptions -XX:+UnsyncloadClass " > #Set the JVM_VENDOR specific JVM flags > if [ "$JVM_VENDOR" =3D "SUN" ]; then > # permgen was removed in Java 8 > VERSION=3D$($JAVA -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).= *"' | awk '{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3= )}' | sed -e 's;\.;;g') > if [ "$VERSION" -lt "80" ]; then > # Check some easily accessible MIN/MAX params for JVM mem usa= ge > if [ "x$JAVA_PERM_MEM" !=3D "x" ]; then > DEFAULT_JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS -XX:PermSize=3D$J= AVA_PERM_MEM" > fi > if [ "x$JAVA_MAX_PERM_MEM" !=3D "x" ]; then > DEFAULT_JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS -XX:MaxPermSize= =3D$JAVA_MAX_PERM_MEM" > fi > fi > DEFAULT_JAVA_OPTS=3D"-server $DEFAULT_JAVA_OPTS -Dcom.sun.managem= ent.jmxremote" > elif [ "$JVM_VENDOR" =3D "IBM" ]; then > if $os400; then > DEFAULT_JAVA_OPTS=3D"$DEFAULT_JAVA_OPTS" > elif $aix; then > DEFAULT_JAVA_OPTS=3D"-Xverify:none -Xdump:heap -Xlp $DEFAULT_= JAVA_OPTS" > else > DEFAULT_JAVA_OPTS=3D"-Xverify:none $DEFAULT_JAVA_OPTS" > fi > fi > # Add the jars in the lib dir > for file in "$KARAF_HOME"/lib/karaf*.jar > do > if [ -z "$CLASSPATH" ]; then > CLASSPATH=3D"$file" > else > CLASSPATH=3D"$CLASSPATH:$file" > fi > done > DEFAULT_JAVA_DEBUG_PORT=3D"5005" > if [ "x$JAVA_DEBUG_PORT" =3D "x" ]; then > JAVA_DEBUG_PORT=3D"$DEFAULT_JAVA_DEBUG_PORT" > fi > DEFAULT_JAVA_DEBUG_OPTS=3D"-agentlib:jdwp=3Dtransport=3Ddt_socket,ser= ver=3Dy,suspend=3Dn,address=3D$JAVA_DEBUG_PORT" > ## > ## TODO: Move to conf/profiler/yourkit.{sh|cmd} > ## > # Uncomment to enable YourKit profiling > #DEFAULT_JAVA_DEBUG_OPTS=3D"-Xrunyjpagent" > } > init() { > # Determine if there is special OS handling we must perform > detectOS > # Unlimit the number of file descriptors if possible > unlimitFD > # Locate the Karaf home directory > locateHome > # Locate the Karaf base directory > locateBase > # Locate the Karaf data directory > locateData > # Locate the Karaf etc directory > locateEtc > # Setup the native library path > setupNativePath > # Locate the Java VM to execute > locateJava > # Determine the JVM vendor > detectJVM > =20 > # Determine the JVM version >=3D 1.6 > checkJvmVersion > # Setup default options > setupDefaults > # Install debug options > setupDebugOptions > } > run() { > OPTS=3D"-Dkaraf.startLocalConsole=3Dtrue -Dkaraf.startRemoteShell=3Dt= rue" > MAIN=3Dorg.apache.karaf.main.Main > while [ "$1" !=3D "" ]; do > case $1 in > 'clean') > rm -Rf "$KARAF_DATA" > shift > ;; > 'debug') > if [ "x$JAVA_DEBUG_OPTS" =3D "x" ]; then > JAVA_DEBUG_OPTS=3D"$DEFAULT_JAVA_DEBUG_OPTS" > fi > JAVA_OPTS=3D"$JAVA_DEBUG_OPTS $JAVA_OPTS" > shift > ;; > 'status') > MAIN=3Dorg.apache.karaf.main.Status > shift > ;; > 'stop') > MAIN=3Dorg.apache.karaf.main.Stop > shift > ;; > 'console') > shift > ;; > 'server') > OPTS=3D"-Dkaraf.startLocalConsole=3Dfalse -Dkaraf.startRe= moteShell=3Dtrue" > shift > ;; > 'client') > OPTS=3D"-Dkaraf.startLocalConsole=3Dtrue -Dkaraf.startRem= oteShell=3Dfalse" > shift > ;; > *) > break > ;; > esac > done > JAVA_ENDORSED_DIRS=3D"${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/= endorsed:${KARAF_HOME}/lib/endorsed" > JAVA_EXT_DIRS=3D"${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARA= F_HOME}/lib/ext" > if $cygwin; then > KARAF_HOME=3D$(cygpath --path --windows "$KARAF_HOME") > KARAF_BASE=3D$(cygpath --path --windows "$KARAF_BASE") > KARAF_DATA=3D$(cygpath --path --windows "$KARAF_DATA") > KARAF_ETC=3D$(cygpath --path --windows "$KARAF_ETC") > if [ ! -z "$CLASSPATH" ]; then > CLASSPATH=3D$(cygpath --path --windows "$CLASSPATH") > fi > JAVA_HOME=3D$(cygpath --path --windows "$JAVA_HOME") > JAVA_ENDORSED_DIRS=3D$(cygpath --path --windows "$JAVA_ENDORSED_D= IRS") > JAVA_EXT_DIRS=3D$(cygpath --path --windows "$JAVA_EXT_DIRS") > fi > cd "$KARAF_BASE" > exec "$JAVA" $JAVA_OPTS -Djava.endorsed.dirs=3D"${JAVA_ENDORSED_DIRS}= " -Djava.ext.dirs=3D"${JAVA_EXT_DIRS}" -Dkaraf.instances=3D"${KARAF_HOME}/i= nstances" -Dkaraf.home=3D"$KARAF_HOME" -Dkaraf.base=3D"$KARAF_BASE" -Dkaraf= .data=3D"$KARAF_DATA" -Dkaraf.etc=3D"$KARAF_ETC" -Djava.io.tmpdir=3D"$KARAF= _DATA/tmp" -Djava.util.logging.config.file=3D"$KARAF_BASE/etc/java.util.log= ging.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" $MAIN "$@" > } > main() { > init > run "$@" > } > main "$@" > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)