This seems to be the one causing this particular issue: 
https://git.opendaylight.org/gerrit/#/c/43030/

Somehow ${PWD} in this patch gets replaced by /w in the generated karaf file 
present in bin.

Making changes to my karaf in-line with this patch worke for me

Victor,
Can you replace the realpath() in your karaf with this:

realpath() {
  OURPWD=${PWD}
  cd "$(dirname "${1}")"
  LINK=$(readlink "$(basename "${1}")")
  while [ "${LINK}" ]; do
    cd "$(dirname "${LINK}")"
    LINK=$(readlink "$(basename "${1}")")
  done
  REALPATH="${PWD}/$(basename "${1}")"
  cd "${OURPWD}"
  echo "${REALPATH}"
}

Reference: 
https://git.opendaylight.org/gerrit/#/c/43030/3/karaf/opendaylight-karaf-resources/src/main/resources/bin/karaf

Regards,
Vishal.

-----Original Message-----
From: Robert Varga [mailto:[email protected]] 
Sent: 04 August 2016 02:15
To: Victor Pickard <[email protected]>; Vishal Thapar 
<[email protected]>; Alexis de Talhouët <[email protected]>
Cc: controller-dev <[email protected]>; 
[email protected]
Subject: Re: [controller-dev] Unable to run karaf [Windows7]

On 08/03/2016 10:24 PM, Victor Pickard wrote:
> Same problem in netvirt.
> 
> On Wed, Aug 3, 2016 at 4:09 PM, Vishal Thapar 
> <[email protected] <mailto:[email protected]>> wrote:
> 
>     Hi,____
> 
>     __ __
> 
>     When trying to run karaf from ovsdb/southbound's karaf I get the
>     following error:____
> 
>     __ __
> 
>     $ ./karaf____
> 
>     ./karaf: line 22: readlink: command not found____
> 
>     *./karaf: line 28: cd: /w: No such file or directory**____*
> 
>     Error: Could not find or load main class 
> org.apache.karaf.main.Main____

FYI, bin/karaf is coming from odlparent, so it affects all projects building a 
distribution.

I do not know why have not seen this earlier, but I am pretty sure it is caused 
by https://git.opendaylight.org/gerrit/39982 which addresses BUG-6027.

What is the environment bin/karaf is expected to run on? My understanding was 
modern UNIX (in which case readlink is a fair request, even Solaris 10 has it), 
but if all we can rely is bashish, we need to explicitly state that in the file 
(along with minumum bash version), so this kind of breakage does not occur 
again.

Bye,
Robert

_______________________________________________
controller-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/controller-dev

Reply via email to