You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by maggu2810 <ma...@gmail.com> on 2015/08/21 14:04:42 UTC

system properties file (multiple ones)

Hello,
there is the file etc/system.properties that could be used ti add system
properties that are available at the very beginning of the Karaf's boot
process.
This file is shipped with karaf and contains already a few such options.

I would like to extend the list of properties. So I can add new lines to
that file.
For a custom distribution (karaf-assembly) I would prefer to do this
additions in a separate file (similar to config.properties and
custom.properties).
So I can add a file with "my" properties and if a new Karaf update changes
the startup.properties file, I have not to change my modified
system.properties copy.

Is there already such a mechanism for the system properties as it is for the
config properties?




--
View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: system properties file (multiple ones)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
bin/setenv

JAVA_OPTS="$JAVA_OPTS 
-Dorg.quartz.properties=${karaf.base}/oh2/runtime/etc/quartz.properties ..."

But, anyway:

https://issues.apache.org/jira/browse/KARAF-3949

Regards
JB

On 08/21/2015 04:14 PM, maggu2810 wrote:
> 2015-08-21 16:07 GMT+02:00 jbonofre [via Karaf]
> <ml...@n3.nabble.com>:
>> Why don't you provision bin/setenv with your System properties ?
>
> I can do that, I just do not know, how this file is evaluated.
> If I add this file to my assembly, can I assume, that there is never
> any content in the distributed setenv? Or have I check after every
> update if the standard setenv contains content now?
>
> At the moment I added this four lines to the system.properties.
> ==
> org.quartz.properties=${karaf.base}/oh2/runtime/etc/quartz.properties
> smarthome.servicecfg=${karaf.base}/oh2/runtime/etc/services.cfg
> smarthome.userdata=${karaf.base}/oh2/userdata
> smarthome.configdir=${karaf.base}/oh2/conf
> ==
>
> Could you point me to the correct content for the setenv?
>
>>
>> I can add a systemoverride.properties file, but it's basically the same
>> as bin/setenv.
>>
>> Regards
>> JB
>>
>> On 08/21/2015 04:01 PM, maggu2810 wrote:
>>
>>> JB, BM explained it correctly.
>>> If I extend the standard file I have to merge the upstream changes all the
>>> time.
>>> I just want to add a file with my system properties that are necessary
>>> for my assembly.
>>>
>>> config.properties could be extended and entries could be overwritten
>>> by custom.properties entries.
>>> system.properties could be extended and entries could be overwritten
>>> by ??? entries.
>>>
>>> 2015-08-21 15:56 GMT+02:00 Benson Margulies [via Karaf]
>>> <[hidden email]>:
>>>> JB, someone might feel squeamish about the process of:
>>>>
>>>> 1) copy file from standard distro
>>>> 2) edit
>>>> 3) include in assembly
>>>>
>>>> . They might be trying to find a way to just put the content they want
>>>> into
>>>> a separate file. I'm a bit confused here, because I could have sworn that
>>>> things I put into custom.properties did indeed work as if they were
>>>> system
>>>> properties, but I guess I might have fooled myself somehow. The sequence
>>>> above is certainly the reliable solution that I think you are referring
>>>> to.
>>>>
>>>>
>>>> On Fri, Aug 21, 2015 at 9:47 AM, Jean-Baptiste Onofré <[hidden email]>
>>>> wrote:
>>>>>
>>>>> It's the same: custom.properties is the "override" of the
>>>>> config.properties, it's not for System properties.
>>>>>
>>>>> @maggu, I'm not sure to understand what you want to do.
>>>>>
>>>>> You want to override or add system.properties ? Why not just updating
>>>>> the
>>>>> system.properties ? Not sure to follow you.
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 08/21/2015 03:44 PM, Benson Margulies wrote:
>>>>>>
>>>>>> Wait, don't use 'overrides.properties',  use 'custom.properties'.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <[hidden email]
>>>>>> <mailto:[hidden email]>> wrote:
>>>>>>
>>>>>>       2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
>>>>>>       <[hidden email]
>>>>>>       <mailto:[hidden email]>>:
>>>>>>
>>>>>>       > It is read at startup. The important question is whether it ends
>>>>>> up
>>>>>> in the
>>>>>>       > etc directory. Have you looked at the generated assembly to see
>>>>>> if
>>>>>> the file
>>>>>>       > is in the right place? Perhaps it's not travelling from
>>>>>> src/main/resources
>>>>>>       > to etc correctly.
>>>>>>
>>>>>>       Tried that one:
>>>>>>
>>>>>>       ===
>>>>>>
>>>>>>       $ cat etc/overrides.properties
>>>>>>       test_overrides=true
>>>>>>
>>>>>>       The file overrides.properties must not be used for this, Karaf
>>>>>> cannot
>>>>>>       be started:
>>>>>>
>>>>>>       2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
>>>>>>       BootFeaturesInstaller            | 8 -
>>>>>> org.apache.karaf.features.core
>>>>>>       - 4.0.0 | Error installing boot features
>>>>>>       java.lang.IllegalArgumentException: No path specified on clause:
>>>>>>       test_overrides = true
>>>>>>                at
>>>>>>
>>>>>>
>>>>>> org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>>>>>>
>>>>>>       ===
>>>>>>
>>>>>>       $ cat etc/override.properties
>>>>>>       test_override=true
>>>>>>
>>>>>>       karaf@root()> system:property | grep test
>>>>>>       karaf@root()>
>>>>>>
>>>>>>       So, the file is not evaluated and the content is not set as system
>>>>>>       properties.
>>>>>>
>>>>>>       ===
>>>>>>
>>>>>>       $ tail -n 1 etc/system.properties
>>>>>>       test_system=true
>>>>>>
>>>>>>       karaf@root()> system:property | grep test
>>>>>>       test_system=true
>>>>>>
>>>>>>       That was expected.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>       --
>>>>>>       View this message in context:
>>>>>>
>>>>>>
>>>>>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>>>>>>       Sent from the Karaf - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> [hidden email]
>>>>> http://blog.nanthrax.net
>>>>> Talend - 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/system-properties-file-multiple-ones-tp4041994p4042004.html
>>>> To unsubscribe from system properties file (multiple ones), click here.
>>>> NAML
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042006.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> [hidden email]
>> http://blog.nanthrax.net
>> Talend - 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/system-properties-file-multiple-ones-tp4041994p4042007.html
>> To unsubscribe from system properties file (multiple ones), click here.
>> NAML
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042009.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: system properties file (multiple ones)

Posted by maggu2810 <ma...@gmail.com>.
2015-08-21 16:07 GMT+02:00 jbonofre [via Karaf]
<ml...@n3.nabble.com>:
> Why don't you provision bin/setenv with your System properties ?

I can do that, I just do not know, how this file is evaluated.
If I add this file to my assembly, can I assume, that there is never
any content in the distributed setenv? Or have I check after every
update if the standard setenv contains content now?

At the moment I added this four lines to the system.properties.
==
org.quartz.properties=${karaf.base}/oh2/runtime/etc/quartz.properties
smarthome.servicecfg=${karaf.base}/oh2/runtime/etc/services.cfg
smarthome.userdata=${karaf.base}/oh2/userdata
smarthome.configdir=${karaf.base}/oh2/conf
==

Could you point me to the correct content for the setenv?

>
> I can add a systemoverride.properties file, but it's basically the same
> as bin/setenv.
>
> Regards
> JB
>
> On 08/21/2015 04:01 PM, maggu2810 wrote:
>
>> JB, BM explained it correctly.
>> If I extend the standard file I have to merge the upstream changes all the
>> time.
>> I just want to add a file with my system properties that are necessary
>> for my assembly.
>>
>> config.properties could be extended and entries could be overwritten
>> by custom.properties entries.
>> system.properties could be extended and entries could be overwritten
>> by ??? entries.
>>
>> 2015-08-21 15:56 GMT+02:00 Benson Margulies [via Karaf]
>> <[hidden email]>:
>>> JB, someone might feel squeamish about the process of:
>>>
>>> 1) copy file from standard distro
>>> 2) edit
>>> 3) include in assembly
>>>
>>> . They might be trying to find a way to just put the content they want
>>> into
>>> a separate file. I'm a bit confused here, because I could have sworn that
>>> things I put into custom.properties did indeed work as if they were
>>> system
>>> properties, but I guess I might have fooled myself somehow. The sequence
>>> above is certainly the reliable solution that I think you are referring
>>> to.
>>>
>>>
>>> On Fri, Aug 21, 2015 at 9:47 AM, Jean-Baptiste Onofré <[hidden email]>
>>> wrote:
>>>>
>>>> It's the same: custom.properties is the "override" of the
>>>> config.properties, it's not for System properties.
>>>>
>>>> @maggu, I'm not sure to understand what you want to do.
>>>>
>>>> You want to override or add system.properties ? Why not just updating
>>>> the
>>>> system.properties ? Not sure to follow you.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 08/21/2015 03:44 PM, Benson Margulies wrote:
>>>>>
>>>>> Wait, don't use 'overrides.properties',  use 'custom.properties'.
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <[hidden email]
>>>>> <mailto:[hidden email]>> wrote:
>>>>>
>>>>>      2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
>>>>>      <[hidden email]
>>>>>      <mailto:[hidden email]>>:
>>>>>
>>>>>      > It is read at startup. The important question is whether it ends
>>>>> up
>>>>> in the
>>>>>      > etc directory. Have you looked at the generated assembly to see
>>>>> if
>>>>> the file
>>>>>      > is in the right place? Perhaps it's not travelling from
>>>>> src/main/resources
>>>>>      > to etc correctly.
>>>>>
>>>>>      Tried that one:
>>>>>
>>>>>      ===
>>>>>
>>>>>      $ cat etc/overrides.properties
>>>>>      test_overrides=true
>>>>>
>>>>>      The file overrides.properties must not be used for this, Karaf
>>>>> cannot
>>>>>      be started:
>>>>>
>>>>>      2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
>>>>>      BootFeaturesInstaller            | 8 -
>>>>> org.apache.karaf.features.core
>>>>>      - 4.0.0 | Error installing boot features
>>>>>      java.lang.IllegalArgumentException: No path specified on clause:
>>>>>      test_overrides = true
>>>>>               at
>>>>>
>>>>>
>>>>> org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>>>>>
>>>>>      ===
>>>>>
>>>>>      $ cat etc/override.properties
>>>>>      test_override=true
>>>>>
>>>>>      karaf@root()> system:property | grep test
>>>>>      karaf@root()>
>>>>>
>>>>>      So, the file is not evaluated and the content is not set as system
>>>>>      properties.
>>>>>
>>>>>      ===
>>>>>
>>>>>      $ tail -n 1 etc/system.properties
>>>>>      test_system=true
>>>>>
>>>>>      karaf@root()> system:property | grep test
>>>>>      test_system=true
>>>>>
>>>>>      That was expected.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      --
>>>>>      View this message in context:
>>>>>
>>>>>
>>>>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>>>>>      Sent from the Karaf - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> [hidden email]
>>>> http://blog.nanthrax.net
>>>> Talend - 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/system-properties-file-multiple-ones-tp4041994p4042004.html
>>> To unsubscribe from system properties file (multiple ones), click here.
>>> NAML
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042006.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
> --
> Jean-Baptiste Onofré
> [hidden email]
> http://blog.nanthrax.net
> Talend - 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/system-properties-file-multiple-ones-tp4041994p4042007.html
> To unsubscribe from system properties file (multiple ones), click here.
> NAML




--
View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042009.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: system properties file (multiple ones)

Posted by maggu2810 <ma...@gmail.com>.
2015-08-21 16:16 GMT+02:00 Benson Margulies [via Karaf]
<ml...@n3.nabble.com>:
> I think that having a whole series of separate override files is a bad
> design, and it would be better to be able to say:
>
> KARAF_ETC=/my/override-directory:/the/directory/with/the/usual/files

An overlay is a nice thing, but you have to respect multiple stuff:
* replace a file with content
* delete a file / replace a file with no content
* extend an existing file

The path for the overlay etc directory must then be hardcoded or in a
separate file, so there is not the same problem with that
configuration.




--
View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042012.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: system properties file (multiple ones)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It's already possible for cfg file: the config.properties contains the 
fileinstall etc location which can contains a list.

And I don't think it makes sense for properties file.

Regards
JB

On 08/21/2015 04:15 PM, Benson Margulies wrote:
> I think that having a whole series of separate override files is a bad
> design, and it would be better to be able to say:
>
> KARAF_ETC=/my/override-directory:/the/directory/with/the/usual/files
>
> If JB ever accepts my first patch, I'd be willing to take a run at
> coding this :-)
>
>
> On Fri, Aug 21, 2015 at 10:13 AM, Andreas Kuhtz <andreas.kuhtz@gmail.com
> <ma...@gmail.com>> wrote:
>
>     Hi JB,
>
>     I had the same requirement some weeks ago and would be happy if
>     systemoverride.properties would be available in the future.
>
>     Regards,
>     Andreas
>
>     2015-08-21 16:06 GMT+02:00 Jean-Baptiste Onofré <jb@nanthrax.net
>     <ma...@nanthrax.net>>:
>
>         Why don't you provision bin/setenv with your System properties ?
>
>         I can add a systemoverride.properties file, but it's basically
>         the same as bin/setenv.
>
>         Regards
>         JB
>
>
>         On 08/21/2015 04:01 PM, maggu2810 wrote:
>
>             JB, BM explained it correctly.
>             If I extend the standard file I have to merge the upstream
>             changes all the time.
>             I just want to add a file with my system properties that are
>             necessary
>             for my assembly.
>
>             config.properties could be extended and entries could be
>             overwritten
>             by custom.properties entries.
>             system.properties could be extended and entries could be
>             overwritten
>             by ??? entries.
>
>             2015-08-21 15:56 GMT+02:00 Benson Margulies [via Karaf]
>             <ml-node+s922171n4042004h80@n3.nabble.com
>             <ma...@n3.nabble.com>>:
>
>                 JB, someone might feel squeamish about the process of:
>
>                 1) copy file from standard distro
>                 2) edit
>                 3) include in assembly
>
>                 . They might be trying to find a way to just put the
>                 content they want into
>                 a separate file. I'm a bit confused here, because I
>                 could have sworn that
>                 things I put into custom.properties did indeed work as
>                 if they were system
>                 properties, but I guess I might have fooled myself
>                 somehow. The sequence
>                 above is certainly the reliable solution that I think
>                 you are referring to.
>
>
>                 On Fri, Aug 21, 2015 at 9:47 AM, Jean-Baptiste Onofré
>                 <[hidden email]>
>                 wrote:
>
>
>                     It's the same: custom.properties is the "override"
>                     of the
>                     config.properties, it's not for System properties.
>
>                     @maggu, I'm not sure to understand what you want to do.
>
>                     You want to override or add system.properties ? Why
>                     not just updating the
>                     system.properties ? Not sure to follow you.
>
>                     Regards
>                     JB
>
>                     On 08/21/2015 03:44 PM, Benson Margulies wrote:
>
>
>                         Wait, don't use 'overrides.properties',  use
>                         'custom.properties'.
>
>
>
>                         On Fri, Aug 21, 2015 at 9:41 AM, maggu2810
>                         <[hidden email]
>                         <mailto:[hidden email]>> wrote:
>
>                               2015-08-21 15:25 GMT+02:00 Benson
>                         Margulies [via Karaf]
>                               <[hidden email]
>                               <mailto:[hidden email]>>:
>
>                               > It is read at startup. The important
>                         question is whether it ends up
>                         in the
>                               > etc directory. Have you looked at the
>                         generated assembly to see if
>                         the file
>                               > is in the right place? Perhaps it's not
>                         travelling from
>                         src/main/resources
>                               > to etc correctly.
>
>                               Tried that one:
>
>                               ===
>
>                               $ cat etc/overrides.properties
>                               test_overrides=true
>
>                               The file overrides.properties must not be
>                         used for this, Karaf cannot
>                               be started:
>
>                               2015-08-21 15:37:50,481 | ERROR |
>                         pool-1-thread-1  |
>                               BootFeaturesInstaller            | 8 -
>                         org.apache.karaf.features.core
>                               - 4.0.0 | Error installing boot features
>                               java.lang.IllegalArgumentException: No
>                         path specified on clause:
>                               test_overrides = true
>                                        at
>
>                         org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>
>                               ===
>
>                               $ cat etc/override.properties
>                               test_override=true
>
>                               karaf@root()> system:property | grep test
>                               karaf@root()>
>
>                               So, the file is not evaluated and the
>                         content is not set as system
>                               properties.
>
>                               ===
>
>                               $ tail -n 1 etc/system.properties
>                               test_system=true
>
>                               karaf@root()> system:property | grep test
>                               test_system=true
>
>                               That was expected.
>
>
>
>
>                               --
>                               View this message in context:
>
>                         http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>                               Sent from the Karaf - User mailing list
>                         archive at Nabble.com.
>
>
>
>                     --
>                     Jean-Baptiste Onofré
>                     [hidden email]
>                     http://blog.nanthrax.net
>                     Talend - 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/system-properties-file-multiple-ones-tp4041994p4042004.html
>                 To unsubscribe from system properties file (multiple
>                 ones), click here.
>                 NAML
>
>
>
>
>
>             --
>             View this message in context:
>             http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042006.html
>             Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>         --
>         Jean-Baptiste Onofré
>         jbonofre@apache.org <ma...@apache.org>
>
>         http://blog.nanthrax.net
>         Talend - http://www.talend.com
>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: system properties file (multiple ones)

Posted by Benson Margulies <be...@basistech.com>.
I think that having a whole series of separate override files is a bad
design, and it would be better to be able to say:

KARAF_ETC=/my/override-directory:/the/directory/with/the/usual/files

If JB ever accepts my first patch, I'd be willing to take a run at coding
this :-)


On Fri, Aug 21, 2015 at 10:13 AM, Andreas Kuhtz <an...@gmail.com>
wrote:

> Hi JB,
>
> I had the same requirement some weeks ago and would be happy if
> systemoverride.properties would be available in the future.
>
> Regards,
> Andreas
>
> 2015-08-21 16:06 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>
>> Why don't you provision bin/setenv with your System properties ?
>>
>> I can add a systemoverride.properties file, but it's basically the same
>> as bin/setenv.
>>
>> Regards
>> JB
>>
>>
>> On 08/21/2015 04:01 PM, maggu2810 wrote:
>>
>>> JB, BM explained it correctly.
>>> If I extend the standard file I have to merge the upstream changes all
>>> the time.
>>> I just want to add a file with my system properties that are necessary
>>> for my assembly.
>>>
>>> config.properties could be extended and entries could be overwritten
>>> by custom.properties entries.
>>> system.properties could be extended and entries could be overwritten
>>> by ??? entries.
>>>
>>> 2015-08-21 15:56 GMT+02:00 Benson Margulies [via Karaf]
>>> <ml...@n3.nabble.com>:
>>>
>>>> JB, someone might feel squeamish about the process of:
>>>>
>>>> 1) copy file from standard distro
>>>> 2) edit
>>>> 3) include in assembly
>>>>
>>>> . They might be trying to find a way to just put the content they want
>>>> into
>>>> a separate file. I'm a bit confused here, because I could have sworn
>>>> that
>>>> things I put into custom.properties did indeed work as if they were
>>>> system
>>>> properties, but I guess I might have fooled myself somehow. The sequence
>>>> above is certainly the reliable solution that I think you are referring
>>>> to.
>>>>
>>>>
>>>> On Fri, Aug 21, 2015 at 9:47 AM, Jean-Baptiste Onofré <[hidden email]>
>>>> wrote:
>>>>
>>>>>
>>>>> It's the same: custom.properties is the "override" of the
>>>>> config.properties, it's not for System properties.
>>>>>
>>>>> @maggu, I'm not sure to understand what you want to do.
>>>>>
>>>>> You want to override or add system.properties ? Why not just updating
>>>>> the
>>>>> system.properties ? Not sure to follow you.
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>> On 08/21/2015 03:44 PM, Benson Margulies wrote:
>>>>>
>>>>>>
>>>>>> Wait, don't use 'overrides.properties',  use 'custom.properties'.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <[hidden email]
>>>>>> <mailto:[hidden email]>> wrote:
>>>>>>
>>>>>>      2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
>>>>>>      <[hidden email]
>>>>>>      <mailto:[hidden email]>>:
>>>>>>
>>>>>>      > It is read at startup. The important question is whether it
>>>>>> ends up
>>>>>> in the
>>>>>>      > etc directory. Have you looked at the generated assembly to
>>>>>> see if
>>>>>> the file
>>>>>>      > is in the right place? Perhaps it's not travelling from
>>>>>> src/main/resources
>>>>>>      > to etc correctly.
>>>>>>
>>>>>>      Tried that one:
>>>>>>
>>>>>>      ===
>>>>>>
>>>>>>      $ cat etc/overrides.properties
>>>>>>      test_overrides=true
>>>>>>
>>>>>>      The file overrides.properties must not be used for this, Karaf
>>>>>> cannot
>>>>>>      be started:
>>>>>>
>>>>>>      2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
>>>>>>      BootFeaturesInstaller            | 8 -
>>>>>> org.apache.karaf.features.core
>>>>>>      - 4.0.0 | Error installing boot features
>>>>>>      java.lang.IllegalArgumentException: No path specified on clause:
>>>>>>      test_overrides = true
>>>>>>               at
>>>>>>
>>>>>>
>>>>>> org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>>>>>>
>>>>>>      ===
>>>>>>
>>>>>>      $ cat etc/override.properties
>>>>>>      test_override=true
>>>>>>
>>>>>>      karaf@root()> system:property | grep test
>>>>>>      karaf@root()>
>>>>>>
>>>>>>      So, the file is not evaluated and the content is not set as
>>>>>> system
>>>>>>      properties.
>>>>>>
>>>>>>      ===
>>>>>>
>>>>>>      $ tail -n 1 etc/system.properties
>>>>>>      test_system=true
>>>>>>
>>>>>>      karaf@root()> system:property | grep test
>>>>>>      test_system=true
>>>>>>
>>>>>>      That was expected.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>      --
>>>>>>      View this message in context:
>>>>>>
>>>>>>
>>>>>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>>>>>>      Sent from the Karaf - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> [hidden email]
>>>>> http://blog.nanthrax.net
>>>>> Talend - 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/system-properties-file-multiple-ones-tp4041994p4042004.html
>>>> To unsubscribe from system properties file (multiple ones), click here.
>>>> NAML
>>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042006.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>>
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
>

Re: system properties file (multiple ones)

Posted by Andreas Kuhtz <an...@gmail.com>.
Hi JB,

I had the same requirement some weeks ago and would be happy if
systemoverride.properties would be available in the future.

Regards,
Andreas

2015-08-21 16:06 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Why don't you provision bin/setenv with your System properties ?
>
> I can add a systemoverride.properties file, but it's basically the same as
> bin/setenv.
>
> Regards
> JB
>
>
> On 08/21/2015 04:01 PM, maggu2810 wrote:
>
>> JB, BM explained it correctly.
>> If I extend the standard file I have to merge the upstream changes all
>> the time.
>> I just want to add a file with my system properties that are necessary
>> for my assembly.
>>
>> config.properties could be extended and entries could be overwritten
>> by custom.properties entries.
>> system.properties could be extended and entries could be overwritten
>> by ??? entries.
>>
>> 2015-08-21 15:56 GMT+02:00 Benson Margulies [via Karaf]
>> <ml...@n3.nabble.com>:
>>
>>> JB, someone might feel squeamish about the process of:
>>>
>>> 1) copy file from standard distro
>>> 2) edit
>>> 3) include in assembly
>>>
>>> . They might be trying to find a way to just put the content they want
>>> into
>>> a separate file. I'm a bit confused here, because I could have sworn that
>>> things I put into custom.properties did indeed work as if they were
>>> system
>>> properties, but I guess I might have fooled myself somehow. The sequence
>>> above is certainly the reliable solution that I think you are referring
>>> to.
>>>
>>>
>>> On Fri, Aug 21, 2015 at 9:47 AM, Jean-Baptiste Onofré <[hidden email]>
>>> wrote:
>>>
>>>>
>>>> It's the same: custom.properties is the "override" of the
>>>> config.properties, it's not for System properties.
>>>>
>>>> @maggu, I'm not sure to understand what you want to do.
>>>>
>>>> You want to override or add system.properties ? Why not just updating
>>>> the
>>>> system.properties ? Not sure to follow you.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 08/21/2015 03:44 PM, Benson Margulies wrote:
>>>>
>>>>>
>>>>> Wait, don't use 'overrides.properties',  use 'custom.properties'.
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <[hidden email]
>>>>> <mailto:[hidden email]>> wrote:
>>>>>
>>>>>      2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
>>>>>      <[hidden email]
>>>>>      <mailto:[hidden email]>>:
>>>>>
>>>>>      > It is read at startup. The important question is whether it
>>>>> ends up
>>>>> in the
>>>>>      > etc directory. Have you looked at the generated assembly to see
>>>>> if
>>>>> the file
>>>>>      > is in the right place? Perhaps it's not travelling from
>>>>> src/main/resources
>>>>>      > to etc correctly.
>>>>>
>>>>>      Tried that one:
>>>>>
>>>>>      ===
>>>>>
>>>>>      $ cat etc/overrides.properties
>>>>>      test_overrides=true
>>>>>
>>>>>      The file overrides.properties must not be used for this, Karaf
>>>>> cannot
>>>>>      be started:
>>>>>
>>>>>      2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
>>>>>      BootFeaturesInstaller            | 8 -
>>>>> org.apache.karaf.features.core
>>>>>      - 4.0.0 | Error installing boot features
>>>>>      java.lang.IllegalArgumentException: No path specified on clause:
>>>>>      test_overrides = true
>>>>>               at
>>>>>
>>>>>
>>>>> org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>>>>>
>>>>>      ===
>>>>>
>>>>>      $ cat etc/override.properties
>>>>>      test_override=true
>>>>>
>>>>>      karaf@root()> system:property | grep test
>>>>>      karaf@root()>
>>>>>
>>>>>      So, the file is not evaluated and the content is not set as system
>>>>>      properties.
>>>>>
>>>>>      ===
>>>>>
>>>>>      $ tail -n 1 etc/system.properties
>>>>>      test_system=true
>>>>>
>>>>>      karaf@root()> system:property | grep test
>>>>>      test_system=true
>>>>>
>>>>>      That was expected.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      --
>>>>>      View this message in context:
>>>>>
>>>>>
>>>>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>>>>>      Sent from the Karaf - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>>
>>>> --
>>>> Jean-Baptiste Onofré
>>>> [hidden email]
>>>> http://blog.nanthrax.net
>>>> Talend - 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/system-properties-file-multiple-ones-tp4041994p4042004.html
>>> To unsubscribe from system properties file (multiple ones), click here.
>>> NAML
>>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042006.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
>
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: system properties file (multiple ones)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Why don't you provision bin/setenv with your System properties ?

I can add a systemoverride.properties file, but it's basically the same 
as bin/setenv.

Regards
JB

On 08/21/2015 04:01 PM, maggu2810 wrote:
> JB, BM explained it correctly.
> If I extend the standard file I have to merge the upstream changes all the time.
> I just want to add a file with my system properties that are necessary
> for my assembly.
>
> config.properties could be extended and entries could be overwritten
> by custom.properties entries.
> system.properties could be extended and entries could be overwritten
> by ??? entries.
>
> 2015-08-21 15:56 GMT+02:00 Benson Margulies [via Karaf]
> <ml...@n3.nabble.com>:
>> JB, someone might feel squeamish about the process of:
>>
>> 1) copy file from standard distro
>> 2) edit
>> 3) include in assembly
>>
>> . They might be trying to find a way to just put the content they want into
>> a separate file. I'm a bit confused here, because I could have sworn that
>> things I put into custom.properties did indeed work as if they were system
>> properties, but I guess I might have fooled myself somehow. The sequence
>> above is certainly the reliable solution that I think you are referring to.
>>
>>
>> On Fri, Aug 21, 2015 at 9:47 AM, Jean-Baptiste Onofré <[hidden email]>
>> wrote:
>>>
>>> It's the same: custom.properties is the "override" of the
>>> config.properties, it's not for System properties.
>>>
>>> @maggu, I'm not sure to understand what you want to do.
>>>
>>> You want to override or add system.properties ? Why not just updating the
>>> system.properties ? Not sure to follow you.
>>>
>>> Regards
>>> JB
>>>
>>> On 08/21/2015 03:44 PM, Benson Margulies wrote:
>>>>
>>>> Wait, don't use 'overrides.properties',  use 'custom.properties'.
>>>>
>>>>
>>>>
>>>> On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <[hidden email]
>>>> <mailto:[hidden email]>> wrote:
>>>>
>>>>      2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
>>>>      <[hidden email]
>>>>      <mailto:[hidden email]>>:
>>>>
>>>>      > It is read at startup. The important question is whether it ends up
>>>> in the
>>>>      > etc directory. Have you looked at the generated assembly to see if
>>>> the file
>>>>      > is in the right place? Perhaps it's not travelling from
>>>> src/main/resources
>>>>      > to etc correctly.
>>>>
>>>>      Tried that one:
>>>>
>>>>      ===
>>>>
>>>>      $ cat etc/overrides.properties
>>>>      test_overrides=true
>>>>
>>>>      The file overrides.properties must not be used for this, Karaf cannot
>>>>      be started:
>>>>
>>>>      2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
>>>>      BootFeaturesInstaller            | 8 - org.apache.karaf.features.core
>>>>      - 4.0.0 | Error installing boot features
>>>>      java.lang.IllegalArgumentException: No path specified on clause:
>>>>      test_overrides = true
>>>>               at
>>>>
>>>> org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>>>>
>>>>      ===
>>>>
>>>>      $ cat etc/override.properties
>>>>      test_override=true
>>>>
>>>>      karaf@root()> system:property | grep test
>>>>      karaf@root()>
>>>>
>>>>      So, the file is not evaluated and the content is not set as system
>>>>      properties.
>>>>
>>>>      ===
>>>>
>>>>      $ tail -n 1 etc/system.properties
>>>>      test_system=true
>>>>
>>>>      karaf@root()> system:property | grep test
>>>>      test_system=true
>>>>
>>>>      That was expected.
>>>>
>>>>
>>>>
>>>>
>>>>      --
>>>>      View this message in context:
>>>>
>>>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>>>>      Sent from the Karaf - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> [hidden email]
>>> http://blog.nanthrax.net
>>> Talend - 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/system-properties-file-multiple-ones-tp4041994p4042004.html
>> To unsubscribe from system properties file (multiple ones), click here.
>> NAML
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042006.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: system properties file (multiple ones)

Posted by maggu2810 <ma...@gmail.com>.
JB, BM explained it correctly.
If I extend the standard file I have to merge the upstream changes all the time.
I just want to add a file with my system properties that are necessary
for my assembly.

config.properties could be extended and entries could be overwritten
by custom.properties entries.
system.properties could be extended and entries could be overwritten
by ??? entries.

2015-08-21 15:56 GMT+02:00 Benson Margulies [via Karaf]
<ml...@n3.nabble.com>:
> JB, someone might feel squeamish about the process of:
>
> 1) copy file from standard distro
> 2) edit
> 3) include in assembly
>
> . They might be trying to find a way to just put the content they want into
> a separate file. I'm a bit confused here, because I could have sworn that
> things I put into custom.properties did indeed work as if they were system
> properties, but I guess I might have fooled myself somehow. The sequence
> above is certainly the reliable solution that I think you are referring to.
>
>
> On Fri, Aug 21, 2015 at 9:47 AM, Jean-Baptiste Onofré <[hidden email]>
> wrote:
>>
>> It's the same: custom.properties is the "override" of the
>> config.properties, it's not for System properties.
>>
>> @maggu, I'm not sure to understand what you want to do.
>>
>> You want to override or add system.properties ? Why not just updating the
>> system.properties ? Not sure to follow you.
>>
>> Regards
>> JB
>>
>> On 08/21/2015 03:44 PM, Benson Margulies wrote:
>>>
>>> Wait, don't use 'overrides.properties',  use 'custom.properties'.
>>>
>>>
>>>
>>> On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>
>>>     2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
>>>     <[hidden email]
>>>     <mailto:[hidden email]>>:
>>>
>>>     > It is read at startup. The important question is whether it ends up
>>> in the
>>>     > etc directory. Have you looked at the generated assembly to see if
>>> the file
>>>     > is in the right place? Perhaps it's not travelling from
>>> src/main/resources
>>>     > to etc correctly.
>>>
>>>     Tried that one:
>>>
>>>     ===
>>>
>>>     $ cat etc/overrides.properties
>>>     test_overrides=true
>>>
>>>     The file overrides.properties must not be used for this, Karaf cannot
>>>     be started:
>>>
>>>     2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
>>>     BootFeaturesInstaller            | 8 - org.apache.karaf.features.core
>>>     - 4.0.0 | Error installing boot features
>>>     java.lang.IllegalArgumentException: No path specified on clause:
>>>     test_overrides = true
>>>              at
>>>
>>> org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>>>
>>>     ===
>>>
>>>     $ cat etc/override.properties
>>>     test_override=true
>>>
>>>     karaf@root()> system:property | grep test
>>>     karaf@root()>
>>>
>>>     So, the file is not evaluated and the content is not set as system
>>>     properties.
>>>
>>>     ===
>>>
>>>     $ tail -n 1 etc/system.properties
>>>     test_system=true
>>>
>>>     karaf@root()> system:property | grep test
>>>     test_system=true
>>>
>>>     That was expected.
>>>
>>>
>>>
>>>
>>>     --
>>>     View this message in context:
>>>
>>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>>>     Sent from the Karaf - User mailing list archive at Nabble.com.
>>>
>>>
>>
>> --
>> Jean-Baptiste Onofré
>> [hidden email]
>> http://blog.nanthrax.net
>> Talend - 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/system-properties-file-multiple-ones-tp4041994p4042004.html
> To unsubscribe from system properties file (multiple ones), click here.
> NAML




--
View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042006.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: system properties file (multiple ones)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
You are right Benson.

Actually, in Karaf, we have three properties files:

1/ startup.properties contains the location of system bundles
2/ system.properties contains System properties, it's the alternative of 
using -Dmy.stuff
3/ config.properties (and included jre.properties and custom.properties) 
are configuration loaded for the OSGi framework and karaf itself

In the case of system.properties, the process would be to provision your 
own system.properties based on the one provided in the standard 
distribution.

Regards
JB

On 08/21/2015 03:56 PM, Benson Margulies wrote:
> JB, someone might feel squeamish about the process of:
>
> 1) copy file from standard distro
> 2) edit
> 3) include in assembly
>
> . They might be trying to find a way to just put the content they want
> into a separate file. I'm a bit confused here, because I could have
> sworn that things I put into custom.properties did indeed work as if
> they were system properties, but I guess I might have fooled myself
> somehow. The sequence above is certainly the reliable solution that I
> think you are referring to.
>
>
> On Fri, Aug 21, 2015 at 9:47 AM, Jean-Baptiste Onofré <jb@nanthrax.net
> <ma...@nanthrax.net>> wrote:
>
>     It's the same: custom.properties is the "override" of the
>     config.properties, it's not for System properties.
>
>     @maggu, I'm not sure to understand what you want to do.
>
>     You want to override or add system.properties ? Why not just
>     updating the system.properties ? Not sure to follow you.
>
>     Regards
>     JB
>
>     On 08/21/2015 03:44 PM, Benson Margulies wrote:
>
>         Wait, don't use 'overrides.properties',  use 'custom.properties'.
>
>
>
>         On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <maggu2810@gmail.com
>         <ma...@gmail.com>
>         <mailto:maggu2810@gmail.com <ma...@gmail.com>>> wrote:
>
>              2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
>              <ml-node+s922171n4041999h25@n3.nabble.com
>         <ma...@n3.nabble.com>
>              <mailto:ml-node%2Bs922171n4041999h25@n3.nabble.com
>         <ma...@n3.nabble.com>>>:
>
>              > It is read at startup. The important question is whether
>         it ends up in the
>              > etc directory. Have you looked at the generated assembly
>         to see if the file
>              > is in the right place? Perhaps it's not travelling from
>         src/main/resources
>              > to etc correctly.
>
>              Tried that one:
>
>              ===
>
>              $ cat etc/overrides.properties
>              test_overrides=true
>
>              The file overrides.properties must not be used for this,
>         Karaf cannot
>              be started:
>
>              2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
>              BootFeaturesInstaller            | 8 -
>         org.apache.karaf.features.core
>              - 4.0.0 | Error installing boot features
>              java.lang.IllegalArgumentException: No path specified on
>         clause:
>              test_overrides = true
>                       at
>
>         org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>
>              ===
>
>              $ cat etc/override.properties
>              test_override=true
>
>              karaf@root()> system:property | grep test
>              karaf@root()>
>
>              So, the file is not evaluated and the content is not set as
>         system
>              properties.
>
>              ===
>
>              $ tail -n 1 etc/system.properties
>              test_system=true
>
>              karaf@root()> system:property | grep test
>              test_system=true
>
>              That was expected.
>
>
>
>
>              --
>              View this message in context:
>         http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>              Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>
>     --
>     Jean-Baptiste Onofré
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: system properties file (multiple ones)

Posted by Benson Margulies <be...@basistech.com>.
JB, someone might feel squeamish about the process of:

1) copy file from standard distro
2) edit
3) include in assembly

. They might be trying to find a way to just put the content they want into
a separate file. I'm a bit confused here, because I could have sworn that
things I put into custom.properties did indeed work as if they were system
properties, but I guess I might have fooled myself somehow. The sequence
above is certainly the reliable solution that I think you are referring to.


On Fri, Aug 21, 2015 at 9:47 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> It's the same: custom.properties is the "override" of the
> config.properties, it's not for System properties.
>
> @maggu, I'm not sure to understand what you want to do.
>
> You want to override or add system.properties ? Why not just updating the
> system.properties ? Not sure to follow you.
>
> Regards
> JB
>
> On 08/21/2015 03:44 PM, Benson Margulies wrote:
>
>> Wait, don't use 'overrides.properties',  use 'custom.properties'.
>>
>>
>>
>> On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <maggu2810@gmail.com
>> <ma...@gmail.com>> wrote:
>>
>>     2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
>>     <ml-node+s922171n4041999h25@n3.nabble.com
>>     <ma...@n3.nabble.com>>:
>>
>>     > It is read at startup. The important question is whether it ends up
>> in the
>>     > etc directory. Have you looked at the generated assembly to see if
>> the file
>>     > is in the right place? Perhaps it's not travelling from
>> src/main/resources
>>     > to etc correctly.
>>
>>     Tried that one:
>>
>>     ===
>>
>>     $ cat etc/overrides.properties
>>     test_overrides=true
>>
>>     The file overrides.properties must not be used for this, Karaf cannot
>>     be started:
>>
>>     2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
>>     BootFeaturesInstaller            | 8 - org.apache.karaf.features.core
>>     - 4.0.0 | Error installing boot features
>>     java.lang.IllegalArgumentException: No path specified on clause:
>>     test_overrides = true
>>              at
>>
>> org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>>
>>     ===
>>
>>     $ cat etc/override.properties
>>     test_override=true
>>
>>     karaf@root()> system:property | grep test
>>     karaf@root()>
>>
>>     So, the file is not evaluated and the content is not set as system
>>     properties.
>>
>>     ===
>>
>>     $ tail -n 1 etc/system.properties
>>     test_system=true
>>
>>     karaf@root()> system:property | grep test
>>     test_system=true
>>
>>     That was expected.
>>
>>
>>
>>
>>     --
>>     View this message in context:
>>
>> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>>     Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: system properties file (multiple ones)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It's the same: custom.properties is the "override" of the 
config.properties, it's not for System properties.

@maggu, I'm not sure to understand what you want to do.

You want to override or add system.properties ? Why not just updating 
the system.properties ? Not sure to follow you.

Regards
JB

On 08/21/2015 03:44 PM, Benson Margulies wrote:
> Wait, don't use 'overrides.properties',  use 'custom.properties'.
>
>
>
> On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <maggu2810@gmail.com
> <ma...@gmail.com>> wrote:
>
>     2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
>     <ml-node+s922171n4041999h25@n3.nabble.com
>     <ma...@n3.nabble.com>>:
>     > It is read at startup. The important question is whether it ends up in the
>     > etc directory. Have you looked at the generated assembly to see if the file
>     > is in the right place? Perhaps it's not travelling from src/main/resources
>     > to etc correctly.
>
>     Tried that one:
>
>     ===
>
>     $ cat etc/overrides.properties
>     test_overrides=true
>
>     The file overrides.properties must not be used for this, Karaf cannot
>     be started:
>
>     2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
>     BootFeaturesInstaller            | 8 - org.apache.karaf.features.core
>     - 4.0.0 | Error installing boot features
>     java.lang.IllegalArgumentException: No path specified on clause:
>     test_overrides = true
>              at
>     org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>
>     ===
>
>     $ cat etc/override.properties
>     test_override=true
>
>     karaf@root()> system:property | grep test
>     karaf@root()>
>
>     So, the file is not evaluated and the content is not set as system
>     properties.
>
>     ===
>
>     $ tail -n 1 etc/system.properties
>     test_system=true
>
>     karaf@root()> system:property | grep test
>     test_system=true
>
>     That was expected.
>
>
>
>
>     --
>     View this message in context:
>     http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
>     Sent from the Karaf - User mailing list archive at Nabble.com.
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: system properties file (multiple ones)

Posted by Benson Margulies <be...@basistech.com>.
Wait, don't use 'overrides.properties',  use 'custom.properties'.



On Fri, Aug 21, 2015 at 9:41 AM, maggu2810 <ma...@gmail.com> wrote:

> 2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
> <ml...@n3.nabble.com>:
> > It is read at startup. The important question is whether it ends up in
> the
> > etc directory. Have you looked at the generated assembly to see if the
> file
> > is in the right place? Perhaps it's not travelling from
> src/main/resources
> > to etc correctly.
>
> Tried that one:
>
> ===
>
> $ cat etc/overrides.properties
> test_overrides=true
>
> The file overrides.properties must not be used for this, Karaf cannot
> be started:
>
> 2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
> BootFeaturesInstaller            | 8 - org.apache.karaf.features.core
> - 4.0.0 | Error installing boot features
> java.lang.IllegalArgumentException: No path specified on clause:
> test_overrides = true
>         at
> org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]
>
> ===
>
> $ cat etc/override.properties
> test_override=true
>
> karaf@root()> system:property | grep test
> karaf@root()>
>
> So, the file is not evaluated and the content is not set as system
> properties.
>
> ===
>
> $ tail -n 1 etc/system.properties
> test_system=true
>
> karaf@root()> system:property | grep test
> test_system=true
>
> That was expected.
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: system properties file (multiple ones)

Posted by maggu2810 <ma...@gmail.com>.
2015-08-21 15:25 GMT+02:00 Benson Margulies [via Karaf]
<ml...@n3.nabble.com>:
> It is read at startup. The important question is whether it ends up in the
> etc directory. Have you looked at the generated assembly to see if the file
> is in the right place? Perhaps it's not travelling from src/main/resources
> to etc correctly.

Tried that one:

===

$ cat etc/overrides.properties
test_overrides=true

The file overrides.properties must not be used for this, Karaf cannot
be started:

2015-08-21 15:37:50,481 | ERROR | pool-1-thread-1  |
BootFeaturesInstaller            | 8 - org.apache.karaf.features.core
- 4.0.0 | Error installing boot features
java.lang.IllegalArgumentException: No path specified on clause:
test_overrides = true
        at org.apache.felix.utils.manifest.Parser.parseClauses(Parser.java:73)[8:org.apache.karaf.features.core:4.0.0]

===

$ cat etc/override.properties
test_override=true

karaf@root()> system:property | grep test
karaf@root()>

So, the file is not evaluated and the content is not set as system properties.

===

$ tail -n 1 etc/system.properties
test_system=true

karaf@root()> system:property | grep test
test_system=true

That was expected.




--
View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4042001.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: system properties file (multiple ones)

Posted by Benson Margulies <be...@basistech.com>.
It is read at startup. The important question is whether it ends up in the
etc directory. Have you looked at the generated assembly to see if the file
is in the right place? Perhaps it's not travelling from src/main/resources
to etc correctly.

On Fri, Aug 21, 2015 at 8:51 AM, maggu2810 <ma...@gmail.com> wrote:

> > The fact is that Karaf reads etc/override.properties and treats its
> > contents as 'overrides' over system.properties. So, my assembly has
> > one of these to set some properties.
>
> At which time the file is read?
> I added a file override.properties to my 'src/main/resources/etc/'
> directory.
> The file is placed as is in the created assembly.
>
> If I start Karaf using the normal script, the stuff in
> override.properties seems not to be read as system properties.
>
> > I could make an argument that KARAF_ETC should be a 'PATH'-like list
> > to avoid having to diddle the contents of files from stock Karaf
>
> I just do not want to change files to add something.
> With every Karaf bump I have to check all such files and merge the
> upstream changes.
>
> > , but
> > for system properties the override.properties files does the job.
>
> I think I do it wrong. Could you give me more details?
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4041998.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: system properties file (multiple ones)

Posted by maggu2810 <ma...@gmail.com>.
> The fact is that Karaf reads etc/override.properties and treats its
> contents as 'overrides' over system.properties. So, my assembly has
> one of these to set some properties.

At which time the file is read?
I added a file override.properties to my 'src/main/resources/etc/' directory.
The file is placed as is in the created assembly.

If I start Karaf using the normal script, the stuff in
override.properties seems not to be read as system properties.

> I could make an argument that KARAF_ETC should be a 'PATH'-like list
> to avoid having to diddle the contents of files from stock Karaf

I just do not want to change files to add something.
With every Karaf bump I have to check all such files and merge the
upstream changes.

> , but
> for system properties the override.properties files does the job.

I think I do it wrong. Could you give me more details?




--
View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4041998.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: system properties file (multiple ones)

Posted by Benson Margulies <be...@basistech.com>.
I am doing this today.

The fact is that Karaf reads etc/override.properties and treats its
contents as 'overrides' over system.properties. So, my assembly has
one of these to set some properties.

I could make an argument that KARAF_ETC should be a 'PATH'-like list
to avoid having to diddle the contents of files from stock Karaf, but
for system properties the override.properties files does the job.


On Fri, Aug 21, 2015 at 8:37 AM, maggu2810 <ma...@gmail.com> wrote:
> Hi,
>
>> So, basically, you can have an empty system.properties, and populate all
>> with -D.
>
> I do not want to change the system.properties that comes with Karaf
> (also not empty it). ;-)
> I would like to add a separate file with system properties.
> Another approach would be if the assembly builder will merge my file
> with the existing system.properties.
> "-D" would imply I add a custom startup script and do not use the
> karaf Script that already shipped with the distribution. But if this
> is the preferred way, I will do so.
>
>> You also use override in system.properties and etc/override.properties.
>
> I do not understand.
>
> The method "setSystemProperty" in
> "system/internal/SystemServiceImpl.java" read the system.properties
> file.
> This method does not use a file called "override.properties".
>
> Thge assembly/Builder does something with a file "override.properties"
> but do not know, how this works ATM.
>
> The issue 2752 (https://issues.apache.org/jira/browse/KARAF-2752),
> states "file in etc/overrides.properties which will contain a list of
> bundle urls to consider as replacements when installing features" and
> the file https://github.com/apache/karaf/blob/master/features/core/src/test/resources/org/apache/karaf/features/internal/service/overrides.properties
> shows also nothing that helped me.
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4041996.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Re: system properties file (multiple ones)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
So use the override.properties: you can provision it with the assembly 
goal as it supports resources.

It's the way we do in SMX.

Regards
JB

On 08/21/2015 02:37 PM, maggu2810 wrote:
> Hi,
>
>> So, basically, you can have an empty system.properties, and populate all
>> with -D.
>
> I do not want to change the system.properties that comes with Karaf
> (also not empty it). ;-)
> I would like to add a separate file with system properties.
> Another approach would be if the assembly builder will merge my file
> with the existing system.properties.
> "-D" would imply I add a custom startup script and do not use the
> karaf Script that already shipped with the distribution. But if this
> is the preferred way, I will do so.
>
>> You also use override in system.properties and etc/override.properties.
>
> I do not understand.
>
> The method "setSystemProperty" in
> "system/internal/SystemServiceImpl.java" read the system.properties
> file.
> This method does not use a file called "override.properties".
>
> Thge assembly/Builder does something with a file "override.properties"
> but do not know, how this works ATM.
>
> The issue 2752 (https://issues.apache.org/jira/browse/KARAF-2752),
> states "file in etc/overrides.properties which will contain a list of
> bundle urls to consider as replacements when installing features" and
> the file https://github.com/apache/karaf/blob/master/features/core/src/test/resources/org/apache/karaf/features/internal/service/overrides.properties
> shows also nothing that helped me.
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4041996.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: system properties file (multiple ones)

Posted by maggu2810 <ma...@gmail.com>.
Hi,

> So, basically, you can have an empty system.properties, and populate all
> with -D.

I do not want to change the system.properties that comes with Karaf
(also not empty it). ;-)
I would like to add a separate file with system properties.
Another approach would be if the assembly builder will merge my file
with the existing system.properties.
"-D" would imply I add a custom startup script and do not use the
karaf Script that already shipped with the distribution. But if this
is the preferred way, I will do so.

> You also use override in system.properties and etc/override.properties.

I do not understand.

The method "setSystemProperty" in
"system/internal/SystemServiceImpl.java" read the system.properties
file.
This method does not use a file called "override.properties".

Thge assembly/Builder does something with a file "override.properties"
but do not know, how this works ATM.

The issue 2752 (https://issues.apache.org/jira/browse/KARAF-2752),
states "file in etc/overrides.properties which will contain a list of
bundle urls to consider as replacements when installing features" and
the file https://github.com/apache/karaf/blob/master/features/core/src/test/resources/org/apache/karaf/features/internal/service/overrides.properties
shows also nothing that helped me.




--
View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994p4041996.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: system properties file (multiple ones)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi

You can use setenv: the system.properties contains System property as 
you can do with -D jvm arg.

So, basically, you can have an empty system.properties, and populate all 
with -D.

You also use override in system.properties and etc/override.properties.

Regards
JB

On 08/21/2015 02:04 PM, maggu2810 wrote:
> Hello,
> there is the file etc/system.properties that could be used ti add system
> properties that are available at the very beginning of the Karaf's boot
> process.
> This file is shipped with karaf and contains already a few such options.
>
> I would like to extend the list of properties. So I can add new lines to
> that file.
> For a custom distribution (karaf-assembly) I would prefer to do this
> additions in a separate file (similar to config.properties and
> custom.properties).
> So I can add a file with "my" properties and if a new Karaf update changes
> the startup.properties file, I have not to change my modified
> system.properties copy.
>
> Is there already such a mechanism for the system properties as it is for the
> config properties?
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/system-properties-file-multiple-ones-tp4041994.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com