Bug 6027 - Can't start karaf using symbolic link 82/39982/12
authorAlexis de Talhouët <adetalhouet@inocybe.com>
Tue, 7 Jun 2016 23:04:15 +0000 (19:04 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Mon, 25 Jul 2016 01:25:09 +0000 (01:25 +0000)
commit0eda999492644870f55582837e469ee3b3729e5d
tree27a85aba7e366ba68c07722837d01534956fa1f9
parent626aa8c246a943e26651b966bb9e1fc302013a23
Bug 6027 - Can't start karaf using symbolic link

When executing the karaf script, it gets the DIRNAME based on $0
which is the path used to start the script. This DIRNAME is then
used to set the KARAF_HOME and multiple other KARAF_* evn variables.

Using a symbolic link, you would have, for instance, usr/bin/karaf
redirecting to /opt/opendaylight/bin/karaf.
So $0 would be usr/bin and not /opt/opendaylight/bin so the locateHome
function isn't setting the right path for the KARAF_HOME.

This ends up failing to start ODL with following ERROR:
Error: Could not find or load main class org.apache.karaf.main.Main

see:
https://github.com/opendaylight/controller/blob/master/karaf/opendaylight-karaf-resources/src/main/resources/bin/karaf#l114l126

Change-Id: I36eff657972768de7d7b90f6563addfc3dd96c0f
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
Co-Authored-By: Michael Vorburger <vorburger@redhat.com>
karaf/opendaylight-karaf-resources/src/main/resources/bin/instance
karaf/opendaylight-karaf-resources/src/main/resources/bin/karaf