Hi Achim,

> Configuration Admin service does have an internal storage, that one is the 
> ConfigRepository

CM is from Felix, CR from Karaf - and it does not implement any interface from 
Felix. So how does CR become an internal storage of Felix CM?

> I doubt you can make this one read-only as it's internal

I don’t want to make this read-only, I tried to use felix.cm.dir to point CM to 
a writable directory.

> Make etc folder read-only that is possible

How? I so far cannot see a possibility as CR seems to always write new configs 
in there.

> Use a different folder then $KARAF_HOME/etc

This seems to be the only possible workaround for me right now, but I actually 
wanted to avoid poving the Karaf *.properties files as well to a writable 
folder and rather wanted to keep it „internal“ to my Karaf distribution (so 
that users do not even think about touching them).

Regards,
Kai

> On 5 Nov 2016, at 12:12, Achim Nierbeck [via Karaf] 
> <[email protected]> wrote:
> 
> Hi Kai, 
> 
> just re-read your first question. 
> I'm not sure if I got all questions right so let me try to explain what I got 
> :)
> 
> 1) Configuration Admin service does have an internal storage, that one is the 
> ConfigRepository, I doubt you can make this one read-only as it's internal
> 2) File-Install and CA are connected only by the property JB gave the 
> description to, but the FileInstall part isn't part of ConfigRepository
> 3) Make etc folder read-only that is possible
> 4) have different etc folders, that is possible, part of FileInstall 
> configuration. 
> 5) Use sub-folders of etc for your own configs, possible. 
> 6) Use a different folder then $KARAF_HOME/etc, it's possible just need to 
> configure it via the start script or set-env.sh 
> 
> 
> regards, Achim
> 
> 
> 
> 2016-11-05 11:29 GMT+01:00 Kai Kreuzer <[hidden email] 
> <x-msg://62/user/SendEmail.jtp?type=node&node=4048578&i=0>>:
> How, can you elaborate on this? My goal is to have etc read-only (obviously 
> including its sub-folders) and karaf.etc is currently hard-coded as the 
> folder to store the configs.
> 
> Cheers,
> Kai
> 
> > On 5 Nov 2016, at 11:09, Achim Nierbeck [via Karaf] <[hidden email] 
> > <x-msg://62/user/SendEmail.jtp?type=node&node=4048578&i=1>> wrote:
> >
> > 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 can 
> > be configured by the 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 
> > > location 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 
> > ConfigAdmin settings in a different place.
> >
> > Probably it would suffice to not hardcode System.getProperty("karaf.etc“) 
> > in ConfigRepository, but come up with a new property here, right?
> >
> > Cheers,
> > Kai
> >
> > > On 5 Nov 2016, at 10:30, jbonofre [via Karaf] <<a href="javascript:;" 
> > > onclick="_e(event, &#39;cvml&#39;, &#[hidden email] 
> > > <x-msg://62/user/SendEmail.jtp?type=node&node=4048578&i=2> 
> > > <mailto:[hidden email] 
> > > <x-msg://62/user/SendEmail.jtp?type=node&node=4048578&i=3>>&#39;)">ml-node+s922171n4048573h63@...>
> > >  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 = 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 = false" - this is what the  Karaf 
> > > > (not
> > > > fileinstall!) documentation 
> > > > <https://karaf.apache.org/manual/latest/#_files 
> > > > <https://karaf.apache.org/manual/latest/#_files> 
> > > > <https://karaf.apache.org/manual/latest/#_files 
> > > > <https://karaf.apache.org/manual/latest/#_files>> 
> > > > <https://karaf.apache.org/manual/latest/#_files 
> > > > <https://karaf.apache.org/manual/latest/#_files> 
> > > > <https://karaf.apache.org/manual/latest/#_files 
> > > > <https://karaf.apache.org/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
> > > >  
> > > > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048570.html>
> > > >  
> > > > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048570.html
> > > >  
> > > > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048570.html>>
> > > >  
> > > > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048570.html
> > > >  
> > > > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048570.html>
> > > >  
> > > > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048570.html
> > > >  
> > > > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048570.html>>>
> > > > Sent from the Karaf - User mailing list archive at Nabble.com 
> > > > <http://nabble.com/ <http://nabble.com/>>.
> > > >
> > >
> > > --
> > > Jean-Baptiste Onofré
> > > [hidden email] <x-msg://58/user/SendEmail. 
> > > <x-msg://58/user/SendEmail.jtp?type=node&node=4048573&i=0>jtp?type=node&node=4048573&i=
> > >  <x-msg://58/user/SendEmail.jtp?type=node&node=4048573&i=0>0 
> > > <x-msg://58/user/SendEmail.jtp?type=node&node=4048573&i=0>>
> > > http://blog.nanthrax.net <http://blog.nanthrax.net/> 
> > > <http://blog.nanthrax.net/ <http://blog.nanthrax.net/>> 
> > > <http://blog.nanthrax.net/ <http://blog.nanthrax.net/> 
> > > <http://blog.nanthrax.net/ <http://blog.nanthrax.net/>>>
> > > Talend - http://www.talend.com <http://www.talend.com/> 
> > > <http://www.talend.com/ <http://www.talend.com/>> <http://www.talend.com/ 
> > > <http://www.talend.com/> <http://www.talend.com/ 
> > > <http://www.talend.com/>>>
> > >
> > >
> > > If you reply to this email, your message will be added to the discussion 
> > > 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>
> > >  
> > > <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>><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>
> > >  
> > > <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 = false ignored?, 
> > > click here 
> > > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4047867&code=a2FpQG9wZW5oYWIub3JnfDQwNDc4Njd8MTExNjQ1MjI3Ng==
> > >  <applewebdata://D6B1B0C7-691B-456D-9B43-301EC2056C55> 
> > > <applewebdata://33A4F3B1-28AC-4AC9-906F-F68282AA8075>>.
> > > NAML 
> > > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >  
> > > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> > >  
> > > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >  
> > > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=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
> >  
> > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048574.html>
> >  
> > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048574.html
> >  
> > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048574.html>>
> > Sent from the Karaf - User mailing list archive at Nabble.com 
> > <http://nabble.com/ <http://nabble.com/>>.
> >
> >
> > --
> >
> > Apache Member
> > Apache Karaf <http://karaf.apache.org/ <http://karaf.apache.org/> 
> > <http://karaf.apache.org/ <http://karaf.apache.org/>>> Committer & PMC
> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ 
> > <http://wiki.ops4j.org/display/paxweb/Pax+Web/> 
> > <http://wiki.ops4j.org/display/paxweb/Pax+Web/ 
> > <http://wiki.ops4j.org/display/paxweb/Pax+Web/>>> Committer & Project Lead
> > blog <http://notizblog.nierbeck.de/ <http://notizblog.nierbeck.de/> 
> > <http://notizblog.nierbeck.de/ <http://notizblog.nierbeck.de/>>>
> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS 
> > <http://bit.ly/1ps9rkS> <http://bit.ly/1ps9rkS <http://bit.ly/1ps9rkS>>>
> >
> > Software Architect / Project Manager / Scrum Master
> >
> >
> >
> >
> > If you reply to this email, your message will be added to the discussion 
> > below:
> > http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048575.html
> >  
> > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048575.html>
> >  
> > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048575.html
> >  
> > <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048575.html>>
> > To unsubscribe from felix.fileinstall.enableConfigSave = false ignored?, 
> > click here 
> > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4047867&code=a2FpQG9wZW5oYWIub3JnfDQwNDc4Njd8MTExNjQ1MjI3Ng==
> >  <applewebdata://D6B1B0C7-691B-456D-9B43-301EC2056C55>>.
> > NAML 
> > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >  
> > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=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-tp4047867p4048576.html
>  
> <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048576.html>
> Sent from the Karaf - User mailing list archive at Nabble.com.
> 
> 
> 
> -- 
> 
> Apache Member
> Apache Karaf <http://karaf.apache.org/ <http://karaf.apache.org/>> Committer 
> & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ 
> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>> Committer & Project Lead
> blog <http://notizblog.nierbeck.de/ <http://notizblog.nierbeck.de/>>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS 
> <http://bit.ly/1ps9rkS>>
> 
> Software Architect / Project Manager / Scrum Master 
> 
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048578.html
>  
> <http://karaf.922171.n3.nabble.com/felix-fileinstall-enableConfigSave-false-ignored-tp4047867p4048578.html>
> To unsubscribe from felix.fileinstall.enableConfigSave = false ignored?, 
> click here 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4047867&code=a2FpQG9wZW5oYWIub3JnfDQwNDc4Njd8MTExNjQ1MjI3Ng==>.
> NAML 
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=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-tp4047867p4048579.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to