Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4005

Different locations for KARAF_HOME and KARAF_BASE

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.1
    • Fix Version/s: 4.0.2
    • Component/s: karaf
    • Labels:
      None

      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.

        Attachments

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              maggu2810 Markus Rathgeb
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: