Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A4594200BBA for ; Sat, 5 Nov 2016 11:09:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A2F06160AEF; Sat, 5 Nov 2016 10:09:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 97D5C160AE0 for ; Sat, 5 Nov 2016 11:09:21 +0100 (CET) Received: (qmail 22718 invoked by uid 500); 5 Nov 2016 10:09:20 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 22708 invoked by uid 99); 5 Nov 2016 10:09:20 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Nov 2016 10:09:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3886CC0708 for ; Sat, 5 Nov 2016 10:09:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.193 X-Spam-Level: *** X-Spam-Status: No, score=3.193 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=googlemail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 3YXhhJi5DBwD for ; Sat, 5 Nov 2016 10:09:16 +0000 (UTC) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 12EB15F19D for ; Sat, 5 Nov 2016 10:09:16 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id f82so33312627wmf.1 for ; Sat, 05 Nov 2016 03:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=7WdifJzk4RseN18BmC8vudyI5D2ddzroeI992Pd/qhA=; b=Qc45wUyH8cJL8nIkcD41iLzZZhYUV5cFOR6bhpPNePnaXySfHbUJV+FJPLPWxCWBJt OckIp7YHYX/VoUtjXrxTkWT7mkLNEneGa1gf6NIEwaOiuxxe8j13L3WIwdzvFzK7+mEA /coJvl5nGjWh5yfzoRz30mI76XygOjOpgITHMorQs9FZzLvfB1kAqdwWNksuHnpa8WvJ Bze9cPVNLxmF44mJ33Nwf7UO30P3M1gvhFmIgR76denrjySFG1+3zk0o4cn6N9JsUECM g6vPGkIlf7H09vjxuNUTReOsCmfq21TXltGS407FCg4IwfJx4qXSJYoHQKMoUYOKUH7t KzDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=7WdifJzk4RseN18BmC8vudyI5D2ddzroeI992Pd/qhA=; b=UwwmbwBu7h8u3WicVeeEcnvV/nRgmTJGI4rL2gWxLpbFvFnEfkCdQk+rADTWkEsVVy CWaNze+LajR3QUhMtusVWG024RmSilQSI4tBVeB1GlC3yblvbKu+LDc8BdPFssTZ3QIG Bl+jdxJ7IeYow5llXcVtYgT0unBVgizxzf1J4GVIDRFgQ4lL5xkJclV0EhSxmpRPSs5E Ftop9Ibs/jROynLH3b9HTiIOWZ9KvH0K9Yo56nPV4bafQ8g6xaWVAcrXM3yNrD60uMJo k1gXKHOsYNEj3ggxeKnbJb4PzqyyYLn5TEPpf94CF17sQtkkAGwXBeyub/rPV9ji4T09 /cdw== X-Gm-Message-State: ABUngvciX+rhq7RqFGjXEzGlz44r3aBKAEeApbYkwA1CC00tEmKyjmLeLlh5EjqllB7krfKicAA+SV9a/vwjzQ== X-Received: by 10.28.170.204 with SMTP id t195mr1026064wme.113.1478340552045; Sat, 05 Nov 2016 03:09:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.101.8 with HTTP; Sat, 5 Nov 2016 03:09:11 -0700 (PDT) In-Reply-To: References: <1473083424662-4047867.post@n3.nabble.com> <7edb2c2e-2adf-1c2b-b68a-040bd5357555@nanthrax.net> <1478287740233-4048570.post@n3.nabble.com> From: Achim Nierbeck Date: Sat, 5 Nov 2016 11:09:11 +0100 Message-ID: Subject: Re: felix.fileinstall.enableConfigSave = false ignored? To: "user@karaf.apache.org" Content-Type: multipart/alternative; boundary=001a1145f6e67640d505408afb40 archived-at: Sat, 05 Nov 2016 10:09:22 -0000 --001a1145f6e67640d505408afb40 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You can use subfolders for a deportation of concern. Regards, Achim Am Samstag, 5. November 2016 schrieb Kai Kreuzer : > Hi JB, > > Thanks for the insights. > > I think what is not yet clear to me is how the ConfigRepository and the > Felix ConfigurationAdmin interoperate. > If I am not mistaken, Karaf uses the Felix ConfigurationAdmin > implementation. From the docs of Felix CM, I see that it persists the > configurations (i.e. does NOT only hold it in memory) and its location ca= n > be configured by the felix.cm.dir property. Is this whole mechanism > disabled in Karaf and the ConfigRepository actually intercepts those call= s? > > > I propose to introduce a user property to let you define the storage > location or disable it. > > > I think this would solve my issue - it would enable users to use differen= t > folders for reading configs through fileinstall and managing the overall > ConfigAdmin settings in a different place. > > Probably it would suffice to not hardcode System.getProperty("karaf.etc= =E2=80=9C) > in ConfigRepository, but come up with a new property here, right? > > Cheers, > Kai > > > On 5 Nov 2016, at 10:30, jbonofre [via Karaf] < > ml-node+s922171n4048573h63@n3.nabble.com > wrote: > > > > Hi, > > > > let me explain a bit. > > > > When you create a config using ConfigAdmin (using the ConfigAdmin > > service), it doesn't create a file (it's in "memory"). In that > > situation, if any change is not persisted to a cfg file. > > On the other hand, if you create a cfg file in Karaf etc folder, then > > the corresponding ConfigAdmin configuration is created and implicitely > > add a felix.fileinstall.filename property. Then, any change to the > > configuration is flush back to the cfg file. > > > > So, in Karaf, you have a feature that automatically create the > > corresponding cfg file when you create a configuration. And after that, > > we are on the "normal" behavior. > > > > The Karaf documentation is correct: when you have the > > felix.fileinstall.filename property in a ConfigAdmin configuration, if > > the enableConfigSave is true, it's flush back to cfg file, false doesn'= t. > > > > The difference is when the configuration is create and without the > > fileinstall.file property. > > In the case, you may want to disable the "auto-create" cfg file done by > > Karaf (ConfigRepository). > > The ConfigRepository is create (in the config feature) like this: > > > > ConfigRepository configRepository =3D new > > ConfigRepositoryImpl(configurationAdmin, new > > File(System.getProperty("karaf.etc"))); > > > > The File is the storage, if null, Karaf doesn't do any storage. > > > > I propose to introduce a user property to let you define the storage > > location or disable it. > > > > Regards > > JB > > > > > > On 11/04/2016 08:29 PM, Kai Kreuzer wrote: > > > > > Hi, > > > > > > I just came across the same issue. I would like to treat the etc > folder as > > > read-only and thus prevent Karaf from doing changes to it. > Nonetheless, I > > > want to keep fileinstall to read configs from etc and push them to > > > ConfigAdmin. > > > > > > I would have expected this to work by merely setting > > > "felix.fileinstall.enableConfigSave =3D false" - this is what the > Karaf (not > > > fileinstall!) documentation manual/latest/#_files > > > > suggests. > > > > > > So what can I do to achieve my goal? What does it mean to "use a null > > > Storage"? What consequences does that have? > > > > > > I hope you can help! > > > > > > Thanks, > > > Kai > > > > > > > > > > > > -- > > > View this message in context: http://karaf.922171.n3.nabble. > com/felix-fileinstall-enableConfigSave-false- > ignored-tp4047867p4048570.html nabble.com/felix-fileinstall-enableConfigSave-false- > ignored-tp4047867p4048570.html> > > > Sent from the Karaf - User mailing list archive at Nabble.com. > > > > > > > -- > > Jean-Baptiste Onofr=C3=A9 > > [hidden email] 0> > > http://blog.nanthrax.net > > Talend - http://www.talend.com > > > > > > If you reply to this email, your message will be added to the discussio= n > below: > > http://karaf.922171.n3.nabble.com/felix-fileinstall- > enableConfigSave-false-ignored-tp4047867p4048573.html < > http://karaf.922171.n3.nabble.com/felix-fileinstall- > enableConfigSave-false-ignored-tp4047867p4048573.html> > > To unsubscribe from felix.fileinstall.enableConfigSave =3D false > ignored?, click here NamlServlet.jtp?macro=3Dunsubscribe_by_code&node=3D4047867&code=3D > a2FpQG9wZW5oYWIub3JnfDQwNDc4Njd8MTExNjQ1MjI3Ng=3D=3D>. > > NAML NamlServlet.jtp?macro=3Dmacro_viewer&id=3Dinstant_html% > 21nabble%3Aemail.naml&base=3Dnabble.naml.namespaces. > BasicNamespace-nabble.view.web.template.NabbleNamespace- > nabble.view.web.template.NodeNamespace&breadcrumbs=3D > notify_subscribers%21nabble%3Aemail.naml-instant_emails% > 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > > > > > -- > View this message in context: http://karaf.922171.n3.nabble. > com/felix-fileinstall-enableConfigSave-false- > ignored-tp4047867p4048574.html > Sent from the Karaf - User mailing list archive at Nabble.com. > --=20 Apache Member Apache Karaf Committer & PMC OPS4J Pax Web Committer & Project Lead blog Co-Author of Apache Karaf Cookbook Software Architect / Project Manager / Scrum Master --001a1145f6e67640d505408afb40 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You can use subfolders for a deportation of concern.

Reg= ards, Achim=C2=A0

Am Samstag, 5. November 2016 schrieb = Kai Kreuzer :
Hi JB,

Thanks for the insights.

I think what is not yet clear to me is how the ConfigRepository and the Fel= ix ConfigurationAdmin interoperate.
If I am not mistaken, Karaf uses the Felix ConfigurationAdmin implementatio= n. From the docs of Felix CM, I see that it persists the configurations (i.= e. does NOT only hold it in memory) and its location can be configured by t= he felix.cm.dir property. Is this whole mechanism disabled in Karaf and the= ConfigRepository actually intercepts those calls?

> I propose to introduce a user property to let you define the storage l= ocation or disable it.


I think this would solve my issue - it would enable users to use different = folders for reading configs through fileinstall and managing the overall Co= nfigAdmin settings in a different place.

Probably it would suffice to not hardcode System.getProperty("karaf.et= c=E2=80=9C) in ConfigRepository, but come up with a new property here,= right?

Cheers,
Kai

> On 5 Nov 2016, at 10:30, jbonofre [via Karaf] <ml-node+s922171n4048573h63@n3.nabble.com> wrote:=
>
> Hi,
>
> let me explain a bit.
>
> When you create a config using ConfigAdmin (using the ConfigAdmin
> service), it doesn't create a file (it's in "memory"= ). In that
> situation, if any change is not persisted to a cfg file.
> On the other hand, if you create a cfg file in Karaf etc folder, then<= br> > the corresponding ConfigAdmin configuration is created and implicitely=
> add a felix.fileinstall.filename property. Then, any change to the
> configuration is flush back to the cfg file.
>
> So, in Karaf, you have a feature that automatically create the
> corresponding cfg file when you create a configuration. And after that= ,
> we are on the "normal" behavior.
>
> The Karaf documentation is correct: when you have the
> felix.fileinstall.filename property in a ConfigAdmin configuration, if=
> the enableConfigSave is true, it's flush back to cfg file, false d= oesn't.
>
> The difference is when the configuration is create and without the
> fileinstall.file property.
> In the case, you may want to disable the "auto-create" cfg f= ile done by
> Karaf (ConfigRepository).
> The ConfigRepository is create (in the config feature) like this:
>
> ConfigRepository configRepository =3D new
> ConfigRepositoryImpl(configurationAdmin, new
> File(System.getProperty("karaf.etc")));
>
> The File is the storage, if null, Karaf doesn't do any storage. >
> I propose to introduce a user property to let you define the storage > location or disable it.
>
> Regards
> JB
>
>
> On 11/04/2016 08:29 PM, Kai Kreuzer wrote:
>
> > Hi,
> >
> > I just came across the same issue. I would like to treat the etc = folder as
> > read-only and thus prevent Karaf from doing changes to it. Noneth= eless, I
> > want to keep fileinstall to read configs from etc and push them t= o
> > ConfigAdmin.
> >
> > I would have expected this to work by merely setting
> > "felix.fileinstall.enableConfigSave =3D false" - t= his is what the=C2=A0 Karaf (not
> > fileinstall!) documentation <https://karaf.apache.org/m= anual/latest/#_files <https://karaf.apache.org/manual/latest/= #_files>>
> > suggests.
> >
> > So what can I do to achieve my goal? What does it mean to "u= se a null
> > Storage"? What consequences does that have?
> >
> > I hope you can help!
> >
> > Thanks,
> > Kai
> >
> >
> >
> > --
> > View this message in context: http://karaf.922171.n3.nabble.com/felix-file= install-enableConfigSave-false-ignored-tp4047867p4048570.html= <http://ka= raf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false= -ignored-tp4047867p4048570.html>
> > Sent from the Karaf - User mailing list archive at Nabble.com. > >
>
> --
> Jean-Baptiste Onofr=C3=A9
> [hidden email] <x-msg://58/user/SendEmail.jtp?type=3Dnode&= node=3D4048573&i=3D0>
> http://blog.nan= thrax.net <h= ttp://blog.nanthrax.net/>
> Talend - http://ww= w.talend.com <h= ttp://www.talend.com/>
>
>
> If you reply to this email, your message will be added to the discussi= on below:
> http://ka= raf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false= -ignored-tp4047867p4048573.html <http://karaf.922171.n3.nabble.com/felix= -fileinstall-enableConfigSave-false-ignored-tp4047867p4048573.htm= l>
> To unsubscribe from felix.fileinstall.enableConfigSave =3D false = ignored?, click here <= http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro= =3Dunsubscribe_by_code&node=3D4047867&code=3Da2FpQG9= wZW5oYWIub3JnfDQwNDc4Njd8MTExNjQ1MjI3Ng=3D=3D>.
> NAML <http://karaf.922= 171.n3.nabble.com/template/NamlServlet.jtp?macro=3Dmacro_vie= wer&id=3Dinstant_html%21nabble%3Aemail.naml&base=3Dnabble= .naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNa= mespace-nabble.view.web.template.NodeNamespace&breadcrumbs=3D= notify_subscribers%21nabble%3Aemail.naml-instant_emails%21na= bble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>= ;




--
View this message in context: http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048574.html
Sent from the Karaf - User mailing list archive at Nabble.com.


--

Apache Member
Apache Karaf <h= ttp://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <h= ttp://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Projec= t Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Coo= kbook <http://bit.ly= /1ps9rkS>

Software Architect / Project Mana= ger / Scrum Master=C2=A0


--001a1145f6e67640d505408afb40--