Karaf
  1. Karaf
  2. KARAF-686

introduce an override flag to configfile element so that we get chance to not override the finalname if it already exist

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.2, 3.0.0
    • Component/s: None
    • Labels:
      None

      Description

      currently http feature has configuration like
      <feature name="http" version="2.2.1" resolver="(obr)">
      <configfile finalname="/etc/jetty.xml">mvn:org.apache.karaf/apache-karaf/2.2.2-SNAPSHOT/xml/jettyconfig</configfile>
      <config name="org.ops4j.pax.web">
      org.osgi.service.http.port=8181
      javax.servlet.context.tempdir=$

      {karaf.data}

      /pax-web-jsp
      org.ops4j.pax.web.config.file=$

      {karaf.base}

      /etc/jetty.xml
      </config>
      This means each time we install http feature it will download jettyconfig.xml remotely and override the local etc/jetty.xml, so any configuration we saved in local etc/jetty.xml will lose.
      We should ship jetty.xml in kit etc folder and always refer it for the http feature, which is easier for customer to configure the jetty.

        Issue Links

          Activity

          Hide
          Jean-Baptiste Onofré added a comment -

          AFAIR, Achim added a jetty.xml in a contrib folder shipped in the Karaf distribution.

          I don't think it's a good idea to embed jetty.xml by default in the Karaf distribution and http feature is an optional one.

          It's clear that we really need to think about a profile mechanism supporting this kind of situation

          Show
          Jean-Baptiste Onofré added a comment - AFAIR, Achim added a jetty.xml in a contrib folder shipped in the Karaf distribution. I don't think it's a good idea to embed jetty.xml by default in the Karaf distribution and http feature is an optional one. It's clear that we really need to think about a profile mechanism supporting this kind of situation
          Hide
          Freeman Fang added a comment -

          as discussed from mailling list, http feature isn't default installed feature so we need change configfile logic so that if etc/jetty.xml exist, don't override it

          Show
          Freeman Fang added a comment - as discussed from mailling list, http feature isn't default installed feature so we need change configfile logic so that if etc/jetty.xml exist, don't override it
          Hide
          Freeman Fang added a comment -

          I'd like to introduce an override flag to configfile element, the default value is true which means we keep same with current behavior.
          However if we specify override="false", then if finalname already exist, then don't override it.
          For example
          <feature name="http" version="2.2.1" resolver="(obr)">
          <configfile finalname="/etc/jetty.xml" override="false">mvn:org.apache.karaf/apache-karaf/2.2.2-SNAPSHOT/xml/jettyconfig</configfile>
          <config name="org.ops4j.pax.web">
          org.osgi.service.http.port=8181
          javax.servlet.context.tempdir=$

          {karaf.data}

          /pax-web-jsp
          org.ops4j.pax.web.config.file=$

          {karaf.base}

          /etc/jetty.xml
          </config>

          If etc/jetty.xml already there, don't download a new one and override it, so that customer specified jetty.xml could be used.

          Show
          Freeman Fang added a comment - I'd like to introduce an override flag to configfile element, the default value is true which means we keep same with current behavior. However if we specify override="false", then if finalname already exist, then don't override it. For example <feature name="http" version="2.2.1" resolver="(obr)"> <configfile finalname="/etc/jetty.xml" override="false">mvn:org.apache.karaf/apache-karaf/2.2.2-SNAPSHOT/xml/jettyconfig</configfile> <config name="org.ops4j.pax.web"> org.osgi.service.http.port=8181 javax.servlet.context.tempdir=$ {karaf.data} /pax-web-jsp org.ops4j.pax.web.config.file=$ {karaf.base} /etc/jetty.xml </config> If etc/jetty.xml already there, don't download a new one and override it, so that customer specified jetty.xml could be used.
          Hide
          Andreas Pieber added a comment -

          IMHO overwriting an existing (possible changed file) is a bug. I can not imagine why someone would really want this behavior. So, from my point of view, using "do-not-overwrite" as default behavior is the better idea.

          just my 2 cents

          Show
          Andreas Pieber added a comment - IMHO overwriting an existing (possible changed file) is a bug. I can not imagine why someone would really want this behavior. So, from my point of view, using "do-not-overwrite" as default behavior is the better idea. just my 2 cents
          Hide
          Freeman Fang added a comment -

          I actually prefer to use override="false" as default behavior as well, then let's go this way

          Show
          Freeman Fang added a comment - I actually prefer to use override="false" as default behavior as well, then let's go this way
          Show
          Freeman Fang added a comment - commit fix http://svn.apache.org/viewvc?rev=1140016&view=rev for trunk http://svn.apache.org/viewvc?rev=1140007&view=rev for 2.2.x branch
          Hide
          Jamie goodyear added a comment -

          Fixed in Apache Karaf 2.2.2.

          Show
          Jamie goodyear added a comment - Fixed in Apache Karaf 2.2.2.
          Hide
          Seth Leger added a comment -

          Can you please add this parameter to the <configfile> section in the provisioning documents at:

          http://karaf.apache.org/manual/latest-2.3.x/users-guide/provisioning.html

          Thanks!

          Show
          Seth Leger added a comment - Can you please add this parameter to the <configfile> section in the provisioning documents at: http://karaf.apache.org/manual/latest-2.3.x/users-guide/provisioning.html Thanks!

            People

            • Assignee:
              Freeman Fang
              Reporter:
              Freeman Fang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development