Details
Description
I would like to change the directories for KARAF_BASE, KARAF_HOME, KARAF_DATE and KARAF_ETC.
Using separate directories for KARAF_BASE and KARAF_HOME result in error messages on start and stop of the Karaf container (I shortened the path):
- Unable to update instance pid: Child instance started but no root
registered in /home/maggu2810/.../karaf/home/instances/instance.properties - Unable to update instance pid: Child instance stopped but no root
registered in /home/maggu2810/.../karaf/home/instances/instance.properties
The class org.apache.karaf.main.InstanceHelper is using:
final boolean isRoot = karafHome.equals(karafBase);
If the properties are empty and isRoot is false, this error message and an IllegalStateException is thrown.
So, IMHO the intention of that variables is to support using different directories. But this seems to be broken (do not run in a problem at runtime after a short test, but the code throw the exception).
http://karaf.922171.n3.nabble.com/Custom-distribution-change-directory-layout-tp4042677p4042691.html
"The purpose of the current variables is more to be able to adapt to your machine/administrator constraint: put KARAF_ETC in /etc/karaf, put KARAF_BASE in /var/karaf and KARAF_HOME in /home/karaf for instance (by moving the directories)."
I checked in an example, so you could easily reproduce it:
repo: git@github.com:maggu2810/karaf-custom-distribution.git
branch: dir-layout
Build it and test the custom artifact.