Hi Charles,

the easiest way is to use Aries Blueprint ext to get env variable.

<blueprint xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"; ...>

  <!-- Load system property -->
  <ext:property-placeholder />

  <bean ...><property name="foobar" value="${foobar}"/></bean>

</blueprint>

You can use it in combination with <cm/> to load system property as default value.

Like this, you can use your env variable as system property:

./karaf -Dfoobar=$FOOBAR

Regards
JB

On 08/24/2012 09:07 AM, Charles Moulliard wrote:
Hi,

Karaf is deployed on a remote Unix machine where I need to get the
following variable :  $OPENSHIFT_INTERNAL_IP which corresponds to this value

[fabric-fuse.rhcloud.com <http://fabric-fuse.rhcloud.com> fabric]\>
printenv | grep OPENSHIFT_INTERNAL
OPENSHIFT_INTERNAL_IP=127.6.51.129

This variable has been added in the file org.ops4j.pax.web.cfg -->
org.ops4j.pax.web.listening.addresses=$OPENSHIFT_INTERNAL_IP

but when Karaf boots, this value is not retrieved

config:list

karaf@root> config:list | grep org.ops4j.pax.web
Pid:            org.ops4j.pax.web
BundleLocation: mvn:org.ops4j.pax.web/pax-web-runtime/1.0.10
    service.pid = org.ops4j.pax.web
    felix.fileinstall.filename =
file:/var/lib/stickshift/2ee23a78e9664b8593ebbc77e16aac38/app-root/runtime/fabric/etc/org.ops4j.pax.web.cfg
    org.ops4j.pax.web.listening.addresses = $OPENSHIFT_INTERNAL_IP

Is there a trick to resolve this enviroment variable ?

Regards,

--
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com



--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to