karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Commented] (KARAF-3461) bin/karaf doesn't use the provided KARAF_HOME
Date Tue, 21 Apr 2015 20:08:01 GMT

    [ https://issues.apache.org/jira/browse/KARAF-3461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14505648#comment-14505648
] 

Jean-Baptiste Onofré commented on KARAF-3461:
---------------------------------------------

Fixed on karaf-3.0.x: https://git-wip-us.apache.org/repos/asf?p=karaf.git;a=commitdiff;h=a7f789a72fd8191ef9ae8ecf8e53fee1ac4642d4

> bin/karaf doesn't use the provided KARAF_HOME
> ---------------------------------------------
>
>                 Key: KARAF-3461
>                 URL: https://issues.apache.org/jira/browse/KARAF-3461
>             Project: Karaf
>          Issue Type: Improvement
>          Components: karaf-core
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 2.4.2, 3.0.4, 4.0.0.M3
>
>
> Currently, if the user sets a KARAF_HOME env variable, Karaf doesn't use it and display
a warning:
> {code}
> locateHome() {
>     if [ "x$KARAF_HOME" != "x" ]; then
>         warn "Ignoring predefined value for KARAF_HOME"
>     fi
>     # In POSIX shells, CDPATH may cause cd to write to stdout
>     (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
>     KARAF_HOME=`cd "$DIRNAME/.."; pwd`
>     if [ ! -d "$KARAF_HOME" ]; then
>         die "KARAF_HOME is not valid: $KARAF_HOME"
>     fi
> }
> {code}
> This behaviour prevents to place karaf script in /usr/bin for instance (or we have to
use a symlink).
> It's particulary interesting with docker.io images (where we can to place karaf script
directly in /bin for instance).
> Actually, we should do something like:
> {code}
> locateHome() {
>     if [ "x$KARAF_HOME" = "x" ]; then
>       # In POSIX shells, CDPATH may cause cd to write to stdout
>     (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
>       KARAF_HOME=`cd "$DIRNAME/.."; pwd`
>     fi
>     if [ ! -d "$KARAF_HOME" ]; then
>         die "KARAF_HOME is not valid: $KARAF_HOME"
>     fi
> }
> {code}
> With this change, if the user sets KARAF_HOME, we use it, else we "fallback" to define
the KARAF_HOME relatively to DIRNAME.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message