karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Bouron (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-5352) KARAF_ETC envvar ignored
Date Fri, 08 Sep 2017 08:14:00 GMT

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

Thomas Bouron commented on KARAF-5352:
--------------------------------------

Thanks for looking into this [~jbonofre]

Let me give you a bit more details. Here are my envvars:
{code}
KARAF_HOME=/opt/brooklyn
KARAF_ETC=/etc/brooklyn
KARAF_REDIRECT=/dev/null
{code}

and the launch command executed:
{code}
/opt/brooklyn/bin/karaf server  >> "$KARAF_REDIRECT" 2>&1
{code}

It is worth noting that on a fresh VM, if I launch without the {{etc}} softlink, Karaf *_seems_*
to start: PID file is created and {{karaf.log}} displays this:
{code}
Sep 07, 2017 4:07:04 PM org.apache.karaf.main.Main launch
INFO: Installing and starting initial bundles
Sep 07, 2017 4:07:04 PM org.apache.karaf.main.Main launch
INFO: All initial bundles installed and set to start
Sep 07, 2017 4:07:04 PM org.apache.karaf.main.lock.SimpleFileLock lock
INFO: Trying to lock /opt/brooklyn-0.12.0-SNAPSHOT/lock
Sep 07, 2017 4:07:04 PM org.apache.karaf.main.lock.SimpleFileLock lock
INFO: Lock acquired
Sep 07, 2017 4:07:04 PM org.apache.karaf.main.Main$KarafLockCallback lockAquired
INFO: Lock acquired. Setting startlevel to 100
{code}

However the application does not start and it's impossible to log into the Karaf shell. Even
if I softlink {{etc}} thereafter, it does the same thing. It seems that the first failed launch
puts Karaf into an unstable state.

BUT, if I setup the {{etc}} softlink *BEFORE* starting Karaf for the first time, it then works.

Hope that is enough details to untangle this issue :)

> KARAF_ETC envvar ignored
> ------------------------
>
>                 Key: KARAF-5352
>                 URL: https://issues.apache.org/jira/browse/KARAF-5352
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-core
>    Affects Versions: 4.1.2
>         Environment: Tested on CentOS 7.x
>            Reporter: Thomas Bouron
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 4.2.0, 4.1.3
>
>
> I'm currently working on upgrading the RPM and DEB packaging for Apache Brooklyn. The
project uses Karaf and has the following folder structure for the RPM package:
> {code}
> /-
>  +- etc
>  |+- brooklyn
>  +- opt
>  |+- brooklyn-0.12.0-SNAPSHOT
>  ||+- bin
>  ||+- data
>  ||+- deploy
>  ||+- lib
>  ||+- system
> {code}
> The {{etc}} folder is not part of {{KARAF_HOME}} but in {{/etc/brooklyn}}. I setup my
{{KARAF_ETC}} to point to this folder, however when I start Karaf, I get the followoing
> {code}
> Sep 07 15:27:14 br-ovx1by-amp-appl-om8x-empty-t0ww-280 systemd[1]: Started Apache Brooklyn
Service.
> Sep 07 15:27:14 br-ovx1by-amp-appl-om8x-empty-t0ww-280 systemd[1]: Starting Apache Brooklyn
Service...
> Sep 07 15:27:14 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: JAVA_HOME not set;
results may vary
> Sep 07 15:27:14 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: karaf: Ignoring predefined
value for KARAF_HOME
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: 15:27:17.085 [pool-1-thread-2]
ERROR org.apache.karaf.features.inte
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: java.io.IOException:
/opt/brooklyn-0.12.0-SNAPSHOT/etc/0d218152-8d8
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.RepositoryImpl.load(R
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.FeaturesServiceImpl.l
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.FeaturesServiceImpl.a
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.FeaturesServiceImpl.a
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.BootFeaturesInstaller
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.BootFeaturesInstaller
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.osgi.Activator.doStart(Activa
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.ja
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.ja
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[?:?]
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExec
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExe
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.lang.Thread.run(Thread.java:748)
[?:?]
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: Caused by: java.io.FileNotFoundException:
/opt/brooklyn-0.12.0-SNAP
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.io.FileInputStream.open0(Native
Method) ~[?:?]
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.io.FileInputStream.open(FileInputStream.java:195)
~[?:?]
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.io.FileInputStream.<init>(FileInputStream.java:138)
~[?:?]
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.io.FileInputStream.<init>(FileInputStream.java:93)
~[?:?]
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConne
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileU
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at java.net.URL.openStream(URL.java:1045)
~[?:?]
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: at org.apache.karaf.features.internal.service.RepositoryImpl.load(R
> Sep 07 15:27:17 br-ovx1by-amp-appl-om8x-empty-t0ww-280 karaf[1919]: ... 12 more
> {code}
> As you can see, karaf expect the {{etc}} folder to be inside {{KARAF_HOME}} even though
I specified my {{KARAF_ETC}} envvar.
> If I softlink {{/etc/brooklyn}} to {{/opt/brooklyn-0.12.0-SNAPSHOT/etc}}, it works. 
> It's also worth mentioning that I don't have this issue with Karaf 4.0.8



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message