Hi,
I have a question regarding pid configuration files and "config:*" karaf
commands.
By default, pid configuration file goes here:
* karaf/etc/*.cfg
I would like to store only our own "foo.bar.*.cfg" pid files in an external
folder (somewhere out of the karaf installation) such as:
* /home/myuser/product/config/foo.bar.*.cfg
My idea was to define this external folder in the "felix.fileinstall.dir"
property in "karaf/etc/config.propertes" as follow:
#
# Configuration FileMonitor properties
#
felix.fileinstall.enableConfigSave = true
felix.fileinstall.dir= /home/myuser/product/config , ${karaf.etc}
felix.fileinstall.filter = .*\\.cfg
...
If our pid files foo.bar.*.cfg are exising (even as empty file) in
/home/myuser/product/config, it is working fine.
I mean, we can edit the files either manuall or using the config:edit,
config:update commands
Now my problem is the following:
I do have an scr @Component which becomes active only when configuration is
created.
So to activate it, I do the following with karaf commands:
karaf@root()> config:edit foo.bar.connection
karaf@root()> config:property-set url ldap://localhost:389
karaf@root()> config:update
My component is activated as expected, no problems here.
Unfortunately, the foo.bar.connection.cfg pid file is created under
${karaf.etc} instead of /home/myuser/product/config
Is there a way to external configuration somehow and ensure that matching
pid files are store there?
Please note that we are using
org.osgi.service.metatype.annotations.ObjectClassDefinition to define our
config
@ObjectClassDefinition(pid = "foo.bar.connection")
public @interface ConnectionConfig {
String url() default "http://localhost:8080";
}
We are currently using karaf 4.0.8.
Thanks for help
Regards,
Christian