added setenv script which sets default memory settings, checks if java is installed and sets the local loopback
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/9dbc43d3 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/9dbc43d3 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/9dbc43d3 Branch: refs/heads/master Commit: 9dbc43d37542ba2195c41556d66f0565c894207d Parents: 3cf8519 Author: Justin Thompson <[email protected]> Authored: Wed Oct 19 12:10:47 2016 +0100 Committer: Justin Thompson <[email protected]> Committed: Wed Oct 19 12:10:47 2016 +0100 ---------------------------------------------------------------------- .../src/main/resources/bin/setenv | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/9dbc43d3/karaf/apache-brooklyn/src/main/resources/bin/setenv ---------------------------------------------------------------------- diff --git a/karaf/apache-brooklyn/src/main/resources/bin/setenv b/karaf/apache-brooklyn/src/main/resources/bin/setenv new file mode 100644 index 0000000..b424f28 --- /dev/null +++ b/karaf/apache-brooklyn/src/main/resources/bin/setenv @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# Brooklyn +# + +# use default memory settings, if not specified +if [ -z "${JAVA_MAX_MEM}" ] ; then + export JAVA_MAX_MEM="2G" +fi +if [ -z "${JAVA_MAX_PERM_MEM}" ] ; then + export JAVA_MAX_PERM_MEM="256m" +fi + +# abort if java is not installed +if [ "x$JAVA" = "x" ]; then + if [ "x$JAVA_HOME" != "x" ]; then + if [ ! -d "$JAVA_HOME" ]; then + echo "Aborting: JAVA_HOME is not valid: $JAVA_HOME" + exit 1 + fi + JAVA="$JAVA_HOME/bin/java" + else + echo "JAVA_HOME not set; results may vary" + JAVA=`type java` + JAVA=`expr "$JAVA" : '.* \(/.*\)$'` + if [ "x$JAVA" = "x" ]; then + echo "Aborting: java command not found" + exit 1 + fi + fi +fi + +# force resolution of localhost to be loopback +export EXTRA_JAVA_OPTS="-Dbrooklyn.location.localhost.address=127.0.0.1 ${EXTRA_JAVA_OPTS}" \ No newline at end of file
