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

Michael Vorburger commented on KARAF-4599:
------------------------------------------

[~jbonofre] I'm NOT a UNIX Shell script crack, BUT I've just played around with 
this, and added this at the top of the startup script to understand, after that 
new first block ending in PROGNAME=`basename "$REALNAME"` :

{noformat}echo "€0 = " $0
echo "REALNAME = " $REALNAME
echo "DIRNAME = " $DIRNAME
echo "PROGNAME = " $PROGNAME{noformat}

AND as far as I can see, what was done in KARAF-4564 is simply completely 
broken, no? I never see any values set for DIRNAME and PROGNAME, and it seems 
to just work by chance.

However, if you REMOVE "> /dev/null 2>&1" from that readlink, so that the first 
line reads:

{noformat}REALNAME=`readlink -e "$0"`{noformat}

THEN it all works great for me. Given that readlink is a command which prints 
to STDOUT, isn't that redirect just plain wrong then? Or am I totally not 
getting something here?

PS: Will someone else with a better understand about Karaf's release management 
and knowledge about whether KARAF-4564 went into master and/or 4.0.x do the 
necessary Affects Version & Fix Version and later cherry-pick correctly etc.

> KARAF-4564 impact: karaf startup command now only works when invoked from 
> current directoy, no longer via absolute path
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: KARAF-4599
>                 URL: https://issues.apache.org/jira/browse/KARAF-4599
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 3.0.7, 3.0.8
>            Reporter: Michael Vorburger
>            Assignee: Jean-Baptiste Onofré
>            Priority: Critical
>             Fix For: 3.0.8
>
>
> KARAF-4564 introduced a fix for "Can't start karaf using symbolic link", but 
> this introduced a new regression: Following that change, the ./karaf startup 
> command now only works when invoked from current directoy, no longer via 
> absolute path.  For example:
> {noformat}git clone git://git.apache.org/karaf.git
> cd karaf
> git checkout karaf-3.0.x
> cd tooling/karaf-maven-plugin
> mvn clean install
> cd ../..
> mvn clean install -DskipTests
> cd assemblies/apache-karaf/target/assembly/bin/
> chmod +x karaf
> ./karaf
> cd ../../../../..
> ./assemblies/apache-karaf/target/assembly/bin/karaf
> Error: Could not find or load main class org.apache.karaf.main.Main
> {noformat}
> Of course we could further fiddle with the startup script to solve this 
> somehow, but it occurred to me that perhaps somewhere on Apache there is a 
> ready made script for this already? Like maybe looking at e.g. how the Maven 
> / Ant & other such tools (Gradle?) would be valuable.
> Perhaps some sort of non-regression integration test for both start-up 
> scenarios, from current as well as via abs. path, would be of value?



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

Reply via email to