You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2014/01/13 04:58:01 UTC

[1/4] git commit: Updated stratos.sh (source: wso2server.sh from WSO2 Carbon 4.2.0)

Updated Branches:
  refs/heads/master f8605c956 -> 8adffee23


Updated stratos.sh (source: wso2server.sh from WSO2 Carbon 4.2.0)


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/6cb59f64
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/6cb59f64
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/6cb59f64

Branch: refs/heads/master
Commit: 6cb59f64b8103b7efc91e8c0cb58b347f9b9991a
Parents: b3420b3
Author: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
Authored: Thu Jan 9 15:08:32 2014 +0530
Committer: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
Committed: Thu Jan 9 15:09:34 2014 +0530

----------------------------------------------------------------------
 .../distribution/src/main/resources/stratos.sh  | 122 ++++++++-------
 .../distribution/src/main/resources/stratos.sh  | 123 ++++++++-------
 .../distribution/src/main/bin/stratos.sh        | 151 ++++++++++---------
 .../modules/distribution/src/bin/stratos.sh     |  41 ++---
 .../stratos-installer/config/cc/bin/stratos.sh  | 121 ++++++++-------
 5 files changed, 295 insertions(+), 263 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
----------------------------------------------------------------------
diff --git a/products/autoscaler/modules/distribution/src/main/resources/stratos.sh b/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
index 0232137..77f7a91 100644
--- a/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
+++ b/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
@@ -1,27 +1,29 @@
 #!/bin/sh
 # ----------------------------------------------------------------------------
-# 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
+#  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
+#      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.
-
+#  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.
 # ----------------------------------------------------------------------------
-# Main Script for the Apache Stratos
+# Main Script for the Apache Stratos (incubating)
 #
 # Environment Variable Prerequisites
 #
+#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
+#                   to figure it out.
+#
 #   JAVA_HOME       Must point at your Java Development Kit installation.
 #
 #   JAVA_OPTS       (Optional) Java runtime options used when the commands
@@ -31,6 +33,7 @@
 # -----------------------------------------------------------------------------
 
 # OS specific support.  $var _must_ be set to either true or false.
+#ulimit -n 100000
 
 cygwin=false;
 darwin=false;
@@ -130,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
   exit 1
 fi
 
+if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
+  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
+fi
+
 # ----- Process the input command ----------------------------------------------
+args=""
 for c in $*
 do
     if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then
@@ -140,29 +148,18 @@ do
           if [ -z "$PORT" ]; then
                 PORT=$c
           fi
-    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
-          CMD="--n"
-          continue
-    elif [ "$CMD" = "--n" ]; then
-          if [ -z "$INSTANCES" ]; then
-                INSTANCES=$c
-          fi
     elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ]; then
           CMD="stop"
     elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start" ]; then
           CMD="start"
-    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" = "console" ]; then
-          CMD="console"
     elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" = "version" ]; then
           CMD="version"
     elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" = "restart" ]; then
           CMD="restart"
-    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ]; then
-          CMD="dump"
     elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ]; then
           CMD="test"
-    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" = "status" ]; then
-          CMD="status"
+    else
+        args="$args $c"
     fi
 done
 
@@ -177,23 +174,35 @@ if [ "$CMD" = "--debug" ]; then
   CMD="RUN"
   JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
   echo "Please start the remote debugging client to continue..."
-elif [ "$CMD" = "--n" ]; then
-  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed 's/[0-9]//g'` ]]; then
-    echo " Please specify the number of instances to start after the --n option"
-    exit 1
-  fi
 elif [ "$CMD" = "start" ]; then
+  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
+    if  ps -p $PID >&- ; then
+      echo "Process is already running"
+      exit 0
+    fi
+  fi
   export CARBON_HOME=$CARBON_HOME
-  nohup $CARBON_HOME/bin/stratos.sh &
+# using nohup bash to avoid erros in solaris OS.TODO
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "stop" ]; then
   export CARBON_HOME=$CARBON_HOME
-  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
+  kill -term `cat $CARBON_HOME/wso2carbon.pid`
   exit 0
 elif [ "$CMD" = "restart" ]; then
   export CARBON_HOME=$CARBON_HOME
-  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
-  nohup $CARBON_HOME/bin/stratos.sh &
+  kill -term `cat $CARBON_HOME/wso2carbon.pid`
+  process_status=0
+  pid=`cat $CARBON_HOME/wso2carbon.pid`
+  while [ "$process_status" -eq "0" ]
+  do
+        sleep 1;
+        ps -p$pid 2>&1 > /dev/null
+        process_status=$?
+  done
+
+# using nohup bash to avoid erros in solaris OS.TODO
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "test" ]; then
     JAVACMD="exec "$JAVACMD""
@@ -230,7 +239,10 @@ do
         CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
     fi
 done
-
+for t in "$CARBON_HOME"/lib/commons-lang*.jar
+do
+    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
+done
 # For Cygwin, switch paths to Windows format before running java
 if $cygwin; then
   JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
@@ -252,25 +264,18 @@ cd "$CARBON_HOME"
 START_EXIT_STATUS=121
 status=$START_EXIT_STATUS
 
+#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property.
+#   -Djava.rmi.server.hostname="your.IP.goes.here"
+
 while [ "$status" = "$START_EXIT_STATUS" ]
 do
     $JAVACMD \
-     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
-     -d64 \
-     -server \
-     -Xms1500m -Xmx3000m \
-     -XX:PermSize=256m -XX:MaxPermSize=512m \
-     -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
-     -XX:+CMSClassUnloadingEnabled \
-     -XX:+OptimizeStringConcat \
-     -XX:+HeapDumpOnOutOfMemoryError \
-     -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
-     -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
-     -XX:ErrorFile=repository/logs/hs_err_pid.log \
-     -XX:OnError="nohup ./stratos.sh &" \
+    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
+    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
+    -server \
+    -XX:+HeapDumpOnOutOfMemoryError \
+    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
     $JAVA_OPTS \
-    -DandesConfig=qpid-config.xml \
-    -Ddisable.cassandra.server.startup=true \
     -Dcom.sun.management.jmxremote \
     -classpath "$CARBON_CLASSPATH" \
     -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
@@ -280,17 +285,20 @@ do
     -Dcarbon.registry.root=/ \
     -Djava.command="$JAVACMD" \
     -Dcarbon.home="$CARBON_HOME" \
-    -Dwso2.transports.xml="$CARBON_HOME/repository/conf/mgt-transports.xml" \
-    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties" \
+    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
     -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
-    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
+    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \
     -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
+    -Dconf.location="$CARBON_HOME/repository/conf"\
     -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
     -Dcom.atomikos.icatch.hide_init_file_path=true \
     -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
     -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
     -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
     -Dorg.terracotta.quartz.skipUpdateCheck=true \
+    -Djava.security.egd=file:/dev/./urandom \
+    -Dfile.encoding=UTF8 \
+    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
     org.wso2.carbon.bootstrap.Bootstrap $*
     status=$?
 done

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
----------------------------------------------------------------------
diff --git a/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh b/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
index 2a5176e..77f7a91 100644
--- a/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
+++ b/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
@@ -1,27 +1,29 @@
 #!/bin/sh
 # ----------------------------------------------------------------------------
-# 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
+#  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
+#      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.
-
+#  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.
 # ----------------------------------------------------------------------------
-# Main Script for the Apache Stratos
+# Main Script for the Apache Stratos (incubating)
 #
 # Environment Variable Prerequisites
 #
+#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
+#                   to figure it out.
+#
 #   JAVA_HOME       Must point at your Java Development Kit installation.
 #
 #   JAVA_OPTS       (Optional) Java runtime options used when the commands
@@ -31,6 +33,7 @@
 # -----------------------------------------------------------------------------
 
 # OS specific support.  $var _must_ be set to either true or false.
+#ulimit -n 100000
 
 cygwin=false;
 darwin=false;
@@ -130,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
   exit 1
 fi
 
+if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
+  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
+fi
+
 # ----- Process the input command ----------------------------------------------
+args=""
 for c in $*
 do
     if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then
@@ -140,29 +148,18 @@ do
           if [ -z "$PORT" ]; then
                 PORT=$c
           fi
-    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
-          CMD="--n"
-          continue
-    elif [ "$CMD" = "--n" ]; then
-          if [ -z "$INSTANCES" ]; then
-                INSTANCES=$c
-          fi
     elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ]; then
           CMD="stop"
     elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start" ]; then
           CMD="start"
-    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" = "console" ]; then
-          CMD="console"
     elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" = "version" ]; then
           CMD="version"
     elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" = "restart" ]; then
           CMD="restart"
-    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ]; then
-          CMD="dump"
     elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ]; then
           CMD="test"
-    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" = "status" ]; then
-          CMD="status"
+    else
+        args="$args $c"
     fi
 done
 
@@ -177,23 +174,35 @@ if [ "$CMD" = "--debug" ]; then
   CMD="RUN"
   JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
   echo "Please start the remote debugging client to continue..."
-elif [ "$CMD" = "--n" ]; then
-  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed 's/[0-9]//g'` ]]; then
-    echo " Please specify the number of instances to start after the --n option"
-    exit 1
-  fi
 elif [ "$CMD" = "start" ]; then
+  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
+    if  ps -p $PID >&- ; then
+      echo "Process is already running"
+      exit 0
+    fi
+  fi
   export CARBON_HOME=$CARBON_HOME
-  nohup $CARBON_HOME/bin/stratos.sh &
+# using nohup bash to avoid erros in solaris OS.TODO
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "stop" ]; then
   export CARBON_HOME=$CARBON_HOME
-  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
+  kill -term `cat $CARBON_HOME/wso2carbon.pid`
   exit 0
 elif [ "$CMD" = "restart" ]; then
   export CARBON_HOME=$CARBON_HOME
-  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
-  nohup $CARBON_HOME/bin/stratos.sh &
+  kill -term `cat $CARBON_HOME/wso2carbon.pid`
+  process_status=0
+  pid=`cat $CARBON_HOME/wso2carbon.pid`
+  while [ "$process_status" -eq "0" ]
+  do
+        sleep 1;
+        ps -p$pid 2>&1 > /dev/null
+        process_status=$?
+  done
+
+# using nohup bash to avoid erros in solaris OS.TODO
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "test" ]; then
     JAVACMD="exec "$JAVACMD""
@@ -230,7 +239,10 @@ do
         CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
     fi
 done
-
+for t in "$CARBON_HOME"/lib/commons-lang*.jar
+do
+    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
+done
 # For Cygwin, switch paths to Windows format before running java
 if $cygwin; then
   JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
@@ -252,25 +264,18 @@ cd "$CARBON_HOME"
 START_EXIT_STATUS=121
 status=$START_EXIT_STATUS
 
+#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property.
+#   -Djava.rmi.server.hostname="your.IP.goes.here"
+
 while [ "$status" = "$START_EXIT_STATUS" ]
 do
     $JAVACMD \
-     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
-     -d64 \
-     -server \
-     -Xms1500m -Xmx3000m \
-     -XX:PermSize=256m -XX:MaxPermSize=512m \
-     -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
-     -XX:+CMSClassUnloadingEnabled \
-     -XX:+OptimizeStringConcat \
-     -XX:+HeapDumpOnOutOfMemoryError \
-     -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
-     -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
-     -XX:ErrorFile=repository/logs/hs_err_pid.log \
-     -XX:OnError="nohup ./stratos.sh &" \
+    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
+    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
+    -server \
+    -XX:+HeapDumpOnOutOfMemoryError \
+    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
     $JAVA_OPTS \
-    -DandesConfig=qpid-config.xml \
-    -Ddisable.cassandra.server.startup=true \
     -Dcom.sun.management.jmxremote \
     -classpath "$CARBON_CLASSPATH" \
     -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
@@ -280,18 +285,20 @@ do
     -Dcarbon.registry.root=/ \
     -Djava.command="$JAVACMD" \
     -Dcarbon.home="$CARBON_HOME" \
-    -Dwso2.transports.xml="$CARBON_HOME/repository/conf/mgt-transports.xml" \
-    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties" \
+    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
     -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
-    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
+    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \
     -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
+    -Dconf.location="$CARBON_HOME/repository/conf"\
     -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
     -Dcom.atomikos.icatch.hide_init_file_path=true \
     -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
-    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
     -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
     -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
     -Dorg.terracotta.quartz.skipUpdateCheck=true \
+    -Djava.security.egd=file:/dev/./urandom \
+    -Dfile.encoding=UTF8 \
+    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
     org.wso2.carbon.bootstrap.Bootstrap $*
     status=$?
 done

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
----------------------------------------------------------------------
diff --git a/products/load-balancer/modules/distribution/src/main/bin/stratos.sh b/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
index 7d8f2f1..77f7a91 100644
--- a/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
+++ b/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
@@ -17,19 +17,23 @@
 #  specific language governing permissions and limitations
 #  under the License.
 # ----------------------------------------------------------------------------
-#  Main Script for the Apache Stratos
+# Main Script for the Apache Stratos (incubating)
 #
-#  Environment Variable Prerequisites
+# Environment Variable Prerequisites
+#
+#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
+#                   to figure it out.
 #
 #   JAVA_HOME       Must point at your Java Development Kit installation.
 #
 #   JAVA_OPTS       (Optional) Java runtime options used when the commands
 #                   is executed.
 #
-#  NOTE: Borrowed generously from Apache Tomcat startup scripts.
+# NOTE: Borrowed generously from Apache Tomcat startup scripts.
 # -----------------------------------------------------------------------------
 
 # OS specific support.  $var _must_ be set to either true or false.
+#ulimit -n 100000
 
 cygwin=false;
 darwin=false;
@@ -129,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
   exit 1
 fi
 
+if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
+  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
+fi
+
 # ----- Process the input command ----------------------------------------------
+args=""
 for c in $*
 do
     if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then
@@ -139,29 +148,18 @@ do
           if [ -z "$PORT" ]; then
                 PORT=$c
           fi
-    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
-          CMD="--n"
-          continue
-    elif [ "$CMD" = "--n" ]; then
-          if [ -z "$INSTANCES" ]; then
-                INSTANCES=$c
-          fi
     elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ]; then
           CMD="stop"
     elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start" ]; then
           CMD="start"
-    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" = "console" ]; then
-          CMD="console"
     elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" = "version" ]; then
           CMD="version"
     elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" = "restart" ]; then
           CMD="restart"
-    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ]; then
-          CMD="dump"
     elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ]; then
           CMD="test"
-    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" = "status" ]; then
-          CMD="status"
+    else
+        args="$args $c"
     fi
 done
 
@@ -176,18 +174,20 @@ if [ "$CMD" = "--debug" ]; then
   CMD="RUN"
   JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
   echo "Please start the remote debugging client to continue..."
-elif [ "$CMD" = "--n" ]; then
-  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed 's/[0-9]//g'` ]]; then
-    echo " Please specify the number of instances to start after the --n option"
-    exit 1
-  fi
 elif [ "$CMD" = "start" ]; then
+  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
+    if  ps -p $PID >&- ; then
+      echo "Process is already running"
+      exit 0
+    fi
+  fi
   export CARBON_HOME=$CARBON_HOME
-  nohup $CARBON_HOME/bin/stratos.sh &
+# using nohup bash to avoid erros in solaris OS.TODO
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "stop" ]; then
   export CARBON_HOME=$CARBON_HOME
-  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
+  kill -term `cat $CARBON_HOME/wso2carbon.pid`
   exit 0
 elif [ "$CMD" = "restart" ]; then
   export CARBON_HOME=$CARBON_HOME
@@ -196,13 +196,13 @@ elif [ "$CMD" = "restart" ]; then
   pid=`cat $CARBON_HOME/wso2carbon.pid`
   while [ "$process_status" -eq "0" ]
   do
-    sleep 1;
-    ps -p$pid 2>&1 > /dev/null
-    process_status=$?
+        sleep 1;
+        ps -p$pid 2>&1 > /dev/null
+        process_status=$?
   done
 
-  # using nohup bash to avoid erros in solaris OS.TODO
-  nohup bash $CARBON_HOME/bin/stratos.sh > /dev/null 2>&1 &
+# using nohup bash to avoid erros in solaris OS.TODO
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "test" ]; then
     JAVACMD="exec "$JAVACMD""
@@ -212,18 +212,11 @@ elif [ "$CMD" = "version" ]; then
   exit 0
 fi
 
+# ---------- Handle the SSL Issue with proper JDK version --------------------
 jdk_16=`$JAVA_HOME/bin/java -version 2>&1 | grep "1.[6|7]"`
-
 if [ "$jdk_16" = "" ]; then
+   echo " Starting WSO2 Carbon (in unsupported JDK)"
    echo " [ERROR] CARBON is supported only on JDK 1.6 and 1.7"
-   exit 1
-fi
-
-CARBON_CLASSPATH=""
-if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
-   if [ "$f" != "$JAVA_HOME/lib/tools.jar" ];then
-        CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar"
-   fi
 fi
 
 CARBON_XBOOTCLASSPATH=""
@@ -236,13 +229,20 @@ done
 
 JAVA_ENDORSED_DIRS="$CARBON_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed"
 
+CARBON_CLASSPATH=""
+if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
+    CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar"
+fi
 for f in "$CARBON_HOME"/bin/*.jar
 do
     if [ "$f" != "$CARBON_HOME/bin/*.jar" ];then
         CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
     fi
 done
-
+for t in "$CARBON_HOME"/lib/commons-lang*.jar
+do
+    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
+done
 # For Cygwin, switch paths to Windows format before running java
 if $cygwin; then
   JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
@@ -261,41 +261,44 @@ echo CARBON_HOME environment variable is set to $CARBON_HOME
 
 cd "$CARBON_HOME"
 
-exec "$JAVACMD" \
-        -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
-        -d64 \
-        -server \
-        -Xms1500m -Xmx3000m \
-        -XX:PermSize=256m -XX:MaxPermSize=512m \
-        -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
-        -XX:+CMSClassUnloadingEnabled \
-        -XX:+OptimizeStringConcat \
-        -XX:+HeapDumpOnOutOfMemoryError \
-        -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
-        -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
-        -XX:ErrorFile=repository/logs/hs_err_pid.log \
-        -XX:OnError="nohup ./stratos.sh &" \
-        $JAVA_OPTS \
-        -Dcarbon.pid=$$ \
-        -Dcom.sun.management.jmxremote \
-        -Dwso2.loadbalancer=true \
-        -classpath "$CARBON_CLASSPATH" \
-        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
-        -Djava.io.tmpdir="$CARBON_HOME/tmp" \
-        -Dwso2.server.standalone=true \
-        -Dcarbon.registry.root=/ \
-        -Dcarbon.home="$CARBON_HOME" \
-        -Dloadbalancer.conf.file="$CARBON_HOME/repository/conf/loadbalancer.conf" \
-        -Djava.util.logging.config.file="$CARBON_HOME/lib/log4j.properties" \
-        -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
-        -Dconf.location="$CARBON_HOME/repository/conf" \
-        -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
-        -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
-        -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
-        -Dcom.atomikos.icatch.hide_init_file_path=true \
-        -Dorg.terracotta.quartz.skipUpdateCheck=true \
-        -Djavax.net.ssl.trustStore=$CARBON_HOME/repository/resources/security/client-truststore.jks \
-        -Djavax.net.ssl.trustStorePassword=wso2carbon \
-        org.wso2.carbon.bootstrap.Bootstrap $*
+START_EXIT_STATUS=121
+status=$START_EXIT_STATUS
 
+#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property.
+#   -Djava.rmi.server.hostname="your.IP.goes.here"
 
+while [ "$status" = "$START_EXIT_STATUS" ]
+do
+    $JAVACMD \
+    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
+    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
+    -server \
+    -XX:+HeapDumpOnOutOfMemoryError \
+    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
+    $JAVA_OPTS \
+    -Dcom.sun.management.jmxremote \
+    -classpath "$CARBON_CLASSPATH" \
+    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
+    -Djava.io.tmpdir="$CARBON_HOME/tmp" \
+    -Dcatalina.base="$CARBON_HOME/lib/tomcat" \
+    -Dwso2.server.standalone=true \
+    -Dcarbon.registry.root=/ \
+    -Djava.command="$JAVACMD" \
+    -Dcarbon.home="$CARBON_HOME" \
+    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
+    -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
+    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \
+    -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
+    -Dconf.location="$CARBON_HOME/repository/conf"\
+    -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
+    -Dcom.atomikos.icatch.hide_init_file_path=true \
+    -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
+    -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
+    -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
+    -Dorg.terracotta.quartz.skipUpdateCheck=true \
+    -Djava.security.egd=file:/dev/./urandom \
+    -Dfile.encoding=UTF8 \
+    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
+    org.wso2.carbon.bootstrap.Bootstrap $*
+    status=$?
+done

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/stratos-manager/modules/distribution/src/bin/stratos.sh
----------------------------------------------------------------------
diff --git a/products/stratos-manager/modules/distribution/src/bin/stratos.sh b/products/stratos-manager/modules/distribution/src/bin/stratos.sh
index 7cb00b5..77f7a91 100755
--- a/products/stratos-manager/modules/distribution/src/bin/stratos.sh
+++ b/products/stratos-manager/modules/distribution/src/bin/stratos.sh
@@ -1,23 +1,25 @@
 #!/bin/sh
 # ----------------------------------------------------------------------------
-#  Copyright 2005-2012 WSO2, Inc. http://www.wso2.org
-#
-#  Licensed 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
+#  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.
-
+#  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.
 # ----------------------------------------------------------------------------
-# Main Script for the WSO2 Carbon Server
+# Main Script for the Apache Stratos (incubating)
 #
-# Environment Variable Prequisites
+# Environment Variable Prerequisites
 #
 #   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
 #                   to figure it out.
@@ -136,6 +138,7 @@ if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
 fi
 
 # ----- Process the input command ----------------------------------------------
+args=""
 for c in $*
 do
     if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then
@@ -155,6 +158,8 @@ do
           CMD="restart"
     elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ]; then
           CMD="test"
+    else
+        args="$args $c"
     fi
 done
 
@@ -178,7 +183,7 @@ elif [ "$CMD" = "start" ]; then
   fi
   export CARBON_HOME=$CARBON_HOME
 # using nohup bash to avoid erros in solaris OS.TODO
-  nohup bash $CARBON_HOME/bin/stratos.sh > /dev/null 2>&1 &
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "stop" ]; then
   export CARBON_HOME=$CARBON_HOME
@@ -197,7 +202,7 @@ elif [ "$CMD" = "restart" ]; then
   done
 
 # using nohup bash to avoid erros in solaris OS.TODO
-  nohup bash $CARBON_HOME/bin/stratos.sh > /dev/null 2>&1 &
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "test" ]; then
     JAVACMD="exec "$JAVACMD""
@@ -267,6 +272,7 @@ do
     $JAVACMD \
     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
     -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
+    -server \
     -XX:+HeapDumpOnOutOfMemoryError \
     -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
     $JAVA_OPTS \
@@ -279,12 +285,11 @@ do
     -Dcarbon.registry.root=/ \
     -Djava.command="$JAVACMD" \
     -Dcarbon.home="$CARBON_HOME" \
-    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties" \
     -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
     -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
+    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \
     -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
     -Dconf.location="$CARBON_HOME/repository/conf"\
-    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
     -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
     -Dcom.atomikos.icatch.hide_init_file_path=true \
     -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
@@ -293,7 +298,7 @@ do
     -Dorg.terracotta.quartz.skipUpdateCheck=true \
     -Djava.security.egd=file:/dev/./urandom \
     -Dfile.encoding=UTF8 \
-    -Dloadbalancer.conf=file:repository/conf/loadbalancer.conf \
+    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
     org.wso2.carbon.bootstrap.Bootstrap $*
     status=$?
 done

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/tools/stratos-installer/config/cc/bin/stratos.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/config/cc/bin/stratos.sh b/tools/stratos-installer/config/cc/bin/stratos.sh
index c9a5812..77f7a91 100644
--- a/tools/stratos-installer/config/cc/bin/stratos.sh
+++ b/tools/stratos-installer/config/cc/bin/stratos.sh
@@ -1,27 +1,29 @@
 #!/bin/sh
 # ----------------------------------------------------------------------------
-# 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
+#  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
+#      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.
-
+#  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.
 # ----------------------------------------------------------------------------
-# Main Script for the Apache Stratos
+# Main Script for the Apache Stratos (incubating)
 #
 # Environment Variable Prerequisites
 #
+#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
+#                   to figure it out.
+#
 #   JAVA_HOME       Must point at your Java Development Kit installation.
 #
 #   JAVA_OPTS       (Optional) Java runtime options used when the commands
@@ -31,6 +33,7 @@
 # -----------------------------------------------------------------------------
 
 # OS specific support.  $var _must_ be set to either true or false.
+#ulimit -n 100000
 
 cygwin=false;
 darwin=false;
@@ -130,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
   exit 1
 fi
 
+if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
+  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
+fi
+
 # ----- Process the input command ----------------------------------------------
+args=""
 for c in $*
 do
     if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ]; then
@@ -140,29 +148,18 @@ do
           if [ -z "$PORT" ]; then
                 PORT=$c
           fi
-    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
-          CMD="--n"
-          continue
-    elif [ "$CMD" = "--n" ]; then
-          if [ -z "$INSTANCES" ]; then
-                INSTANCES=$c
-          fi
     elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ]; then
           CMD="stop"
     elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start" ]; then
           CMD="start"
-    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" = "console" ]; then
-          CMD="console"
     elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" = "version" ]; then
           CMD="version"
     elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" = "restart" ]; then
           CMD="restart"
-    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ]; then
-          CMD="dump"
     elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ]; then
           CMD="test"
-    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" = "status" ]; then
-          CMD="status"
+    else
+        args="$args $c"
     fi
 done
 
@@ -177,23 +174,35 @@ if [ "$CMD" = "--debug" ]; then
   CMD="RUN"
   JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
   echo "Please start the remote debugging client to continue..."
-elif [ "$CMD" = "--n" ]; then
-  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed 's/[0-9]//g'` ]]; then
-    echo " Please specify the number of instances to start after the --n option"
-    exit 1
-  fi
 elif [ "$CMD" = "start" ]; then
+  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
+    if  ps -p $PID >&- ; then
+      echo "Process is already running"
+      exit 0
+    fi
+  fi
   export CARBON_HOME=$CARBON_HOME
-  nohup $CARBON_HOME/bin/stratos.sh &
+# using nohup bash to avoid erros in solaris OS.TODO
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "stop" ]; then
   export CARBON_HOME=$CARBON_HOME
-  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
+  kill -term `cat $CARBON_HOME/wso2carbon.pid`
   exit 0
 elif [ "$CMD" = "restart" ]; then
   export CARBON_HOME=$CARBON_HOME
-  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
-  nohup $CARBON_HOME/bin/stratos.sh &
+  kill -term `cat $CARBON_HOME/wso2carbon.pid`
+  process_status=0
+  pid=`cat $CARBON_HOME/wso2carbon.pid`
+  while [ "$process_status" -eq "0" ]
+  do
+        sleep 1;
+        ps -p$pid 2>&1 > /dev/null
+        process_status=$?
+  done
+
+# using nohup bash to avoid erros in solaris OS.TODO
+  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
   exit 0
 elif [ "$CMD" = "test" ]; then
     JAVACMD="exec "$JAVACMD""
@@ -230,7 +239,10 @@ do
         CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
     fi
 done
-
+for t in "$CARBON_HOME"/lib/commons-lang*.jar
+do
+    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
+done
 # For Cygwin, switch paths to Windows format before running java
 if $cygwin; then
   JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
@@ -252,25 +264,18 @@ cd "$CARBON_HOME"
 START_EXIT_STATUS=121
 status=$START_EXIT_STATUS
 
+#To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property.
+#   -Djava.rmi.server.hostname="your.IP.goes.here"
+
 while [ "$status" = "$START_EXIT_STATUS" ]
 do
     $JAVACMD \
-     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
-     -d64 \
-     -server \
-     -Xms1500m -Xmx3000m \
-     -XX:PermSize=256m -XX:MaxPermSize=512m \
-     -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
-     -XX:+CMSClassUnloadingEnabled \
-     -XX:+OptimizeStringConcat \
-     -XX:+HeapDumpOnOutOfMemoryError \
-     -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
-     -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
-     -XX:ErrorFile=repository/logs/hs_err_pid.log \
-     -XX:OnError="nohup ./stratos.sh &" \
+    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
+    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
+    -server \
+    -XX:+HeapDumpOnOutOfMemoryError \
+    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
     $JAVA_OPTS \
-    -DandesConfig=qpid-config.xml \
-    -Ddisable.cassandra.server.startup=true \
     -Dcom.sun.management.jmxremote \
     -classpath "$CARBON_CLASSPATH" \
     -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
@@ -280,16 +285,20 @@ do
     -Dcarbon.registry.root=/ \
     -Djava.command="$JAVACMD" \
     -Dcarbon.home="$CARBON_HOME" \
-    -Dwso2.transports.xml="$CARBON_HOME/repository/conf/mgt-transports.xml" \
-    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties" \
+    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
     -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
+    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \
     -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
+    -Dconf.location="$CARBON_HOME/repository/conf"\
     -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
     -Dcom.atomikos.icatch.hide_init_file_path=true \
     -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
     -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
     -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
     -Dorg.terracotta.quartz.skipUpdateCheck=true \
+    -Djava.security.egd=file:/dev/./urandom \
+    -Dfile.encoding=UTF8 \
+    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
     org.wso2.carbon.bootstrap.Bootstrap $*
     status=$?
 done


[4/4] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos

Posted by is...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/8adffee2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/8adffee2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/8adffee2

Branch: refs/heads/master
Commit: 8adffee23ae31541c747c391d93fae821776958f
Parents: f928c49 f8605c9
Author: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
Authored: Mon Jan 13 08:57:57 2014 +0530
Committer: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
Committed: Mon Jan 13 08:57:57 2014 +0530

----------------------------------------------------------------------
 .../stratos/autoscaler/PartitionContext.java    |   2 +-
 .../autoscaler/rule/RuleTasksDelegator.java     |   2 -
 .../console/README.md                           |  36 +---
 .../console/config/console.json                 |   2 +-
 .../controllers/cartridgeDefintionSubmit.jag    |   8 +
 .../console/controllers/login.jag               |   8 +-
 .../theme1/partials/cartridge_deployments.hbs   |  21 ++-
 .../console/util/utility.jag                    |   4 +
 .../sso/views/login.jag                         |   2 +-
 .../stratos/manager/deploy/service/Service.java |  13 +-
 .../service/ServiceDeploymentManager.java       |  11 ++
 .../manager/lookup/LookupDataHolder.java        |  23 +++
 .../lookup/TenantIdToSubscriptionContext.java   |   6 +
 .../DataInsertionAndRetrievalManager.java       |  14 ++
 .../SubscriptionMultiTenantBehaviour.java       |  29 +++-
 .../InstanceNotifierMessageProcessorChain.java  |   3 +
 ...tractAuthenticationAuthorizationHandler.java |  46 +++++
 .../rest/endpoint/handlers/OAuthHandler.java    |   9 +-
 .../handlers/StratosAuthenticationHandler.java  |  10 +-
 .../handlers/StratosAuthorizingHandler.java     |   8 +-
 .../rest/endpoint/services/ServiceUtils.java    |  14 ++
 .../main/webapp/stratos/WEB-INF/cxf-servlet.xml |  11 +-
 .../distribution/src/main/conf/scaling.drl      | 173 +++++++------------
 .../conf/application-authenticators.xml         |  23 +++
 .../modules/distribution/src/assembly/bin.xml   |   6 +
 .../modules/p2-profile-gen/pom.xml              |  14 ++
 26 files changed, 324 insertions(+), 174 deletions(-)
----------------------------------------------------------------------



[3/4] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos

Posted by is...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/f928c492
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/f928c492
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/f928c492

Branch: refs/heads/master
Commit: f928c4924e3db1c74fb3273d1ee7328ab558c829
Parents: c5f5cbf 4506c59
Author: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
Authored: Fri Jan 10 17:45:43 2014 +0530
Committer: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
Committed: Fri Jan 10 17:45:43 2014 +0530

----------------------------------------------------------------------
 .../org.apache.stratos.autoscaler/pom.xml       |    7 +
 .../apache/stratos/autoscaler/Constants.java    |    6 +
 .../controller/InstanceNotificationClient.java  |   71 +
 .../health/AutoscalerHealthStatReceiver.java    |  249 +-
 .../topology/AutoscalerTopologyReceiver.java    |   36 +-
 .../autoscaler/rule/RuleTasksDelegator.java     |   10 +
 .../stratos/cartridge/agent/CartridgeAgent.java |   60 +-
 .../agent/util/CartridgeAgentConstants.java     |    1 +
 .../cartridge/agent/util/ExtensionUtils.java    |   13 +
 .../stratos/cli/RestCommandLineService.java     |    2 +-
 .../cloud/controller/pojo/ClusterContext.java   |   10 +-
 .../topology/TopologyEventPublisher.java        |    3 +-
 .../stratos/common/beans/TenantInfoBean.java    |   19 +
 .../org.apache.stratos.manager.console/LICENSE  |  191 -
 .../org.apache.stratos.manager.console/README   |    1 -
 .../README.md                                   |   33 -
 .../apis/README                                 |    1 -
 .../org.apache.stratos.manager.console/app.js   |   14 -
 .../cartridge_deployments.jag                   |    9 -
 .../cartridges.jag                              |    7 -
 .../config/console.js                           |    8 -
 .../config/console.json                         |   22 -
 .../configure_stratos.jag                       |    7 -
 .../console/LICENSE                             |  191 +
 .../console/README                              |    1 +
 .../console/README.md                           |   33 +
 .../console/apis/README                         |    1 +
 .../console/app.js                              |   14 +
 .../console/cartridge_deployments.jag           |    9 +
 .../console/cartridges.jag                      |    8 +
 .../console/config/console.js                   |    8 +
 .../console/config/console.json                 |   22 +
 .../console/configure_stratos.jag               |    7 +
 .../console/controllers/README                  |    1 +
 .../console/controllers/acs.jag                 |   93 +
 .../console/controllers/login.jag               |   37 +
 .../console/controllers/logout.jag              |   41 +
 .../console/controllers/payloadFactory.jag      |   50 +
 .../console/controllers/profileClient.jag       |   58 +
 .../console/data/cartridge_deployments.json     |   10 +
 .../console/data/cartridges.json                |   35 +
 .../console/data/config_status.json             |    4 +
 .../console/data/lbs.json                       |   10 +
 .../console/data/mt_service_deployments.json    |   10 +
 .../console/data/mycartridges.json              |   35 +
 .../console/data/partition_deployments.json     |   10 +
 .../console/data/policy_deployments.json        |   10 +
 .../console/index.jag                           |    8 +
 .../console/jaggery.conf                        |    3 +
 .../console/js/dialog.js                        |  369 +
 .../console/js/main.js                          |   19 +
 .../console/lbs.jag                             |    9 +
 .../console/login.jag                           |    5 +
 .../console/modules/README                      |    1 +
 .../console/mt_service_deployments.jag          |    9 +
 .../console/partition_deployments.jag           |    9 +
 .../console/policy_deployments.jag              |    9 +
 .../console/root-js                             |  369 +
 .../console/subscribe_cartridge.jag             |    6 +
 .../console/themes/README                       |    1 +
 .../console/themes/theme1/pages/index.hbs       |   78 +
 .../theme1/partials/cartridge_deployments.hbs   |   90 +
 .../themes/theme1/partials/cartridges.hbs       |   37 +
 .../theme1/partials/configure_stratos.hbs       |   48 +
 .../console/themes/theme1/partials/header.hbs   |  105 +
 .../console/themes/theme1/partials/lbs.hbs      |   90 +
 .../console/themes/theme1/partials/login.hbs    |   31 +
 .../theme1/partials/mt_service_deployments.hbs  |   90 +
 .../themes/theme1/partials/mycartridges.hbs     |    7 +
 .../theme1/partials/partition_deployments.hbs   |  129 +
 .../theme1/partials/policy_deployments.hbs      |   90 +
 .../theme1/partials/subscribe_cartridge.hbs     |  125 +
 .../console/themes/theme1/partials/title.hbs    |    1 +
 .../themes/theme1/renderers/account_recovery.js |   23 +
 .../theme1/renderers/cartridge_deployments.js   |   47 +
 .../themes/theme1/renderers/cartridges.js       |   72 +
 .../theme1/renderers/configure_stratos.js       |   42 +
 .../console/themes/theme1/renderers/index.js    |   68 +
 .../console/themes/theme1/renderers/lbs.js      |   47 +
 .../console/themes/theme1/renderers/login.js    |   22 +
 .../theme1/renderers/mt_service_deployments.js  |   47 +
 .../theme1/renderers/partition_deployments.js   |   47 +
 .../theme1/renderers/policy_deployments.js      |   47 +
 .../theme1/renderers/subscribe_cartridge.js     |   37 +
 .../console/themes/theme1/theme.js              |    1 +
 .../console/themes/theme1/ui/404.html           |  157 +
 .../ui/apple-touch-icon-114x114-precomposed.png |  Bin 0 -> 1189 bytes
 .../ui/apple-touch-icon-144x144-precomposed.png |  Bin 0 -> 1475 bytes
 .../ui/apple-touch-icon-57x57-precomposed.png   |  Bin 0 -> 730 bytes
 .../ui/apple-touch-icon-72x72-precomposed.png   |  Bin 0 -> 854 bytes
 .../theme1/ui/apple-touch-icon-precomposed.png  |  Bin 0 -> 730 bytes
 .../themes/theme1/ui/apple-touch-icon.png       |  Bin 0 -> 730 bytes
 .../console/themes/theme1/ui/crossdomain.xml    |   15 +
 .../themes/theme1/ui/css/bootstrap-missing.css  |  995 +++
 .../themes/theme1/ui/css/bootstrap-theme.css    |  404 ++
 .../theme1/ui/css/bootstrap-theme.min.css       |    1 +
 .../console/themes/theme1/ui/css/bootstrap.css  | 6805 ++++++++++++++++++
 .../themes/theme1/ui/css/bootstrap.min.css      |    9 +
 .../console/themes/theme1/ui/css/dialog.css     |  128 +
 .../console/themes/theme1/ui/css/main.css       |  363 +
 .../images/222222_11x11_icon_close.gif          |  Bin 0 -> 62 bytes
 .../images/222222_11x11_icon_resize_se.gif      |  Bin 0 -> 61 bytes
 .../smoothness/images/222222_7x7_arrow_left.gif |  Bin 0 -> 53 bytes
 .../images/222222_7x7_arrow_right.gif           |  Bin 0 -> 53 bytes
 .../images/454545_11x11_icon_close.gif          |  Bin 0 -> 62 bytes
 .../smoothness/images/454545_7x7_arrow_left.gif |  Bin 0 -> 53 bytes
 .../images/454545_7x7_arrow_right.gif           |  Bin 0 -> 53 bytes
 .../images/888888_11x11_icon_close.gif          |  Bin 0 -> 62 bytes
 .../smoothness/images/888888_7x7_arrow_left.gif |  Bin 0 -> 53 bytes
 .../images/888888_7x7_arrow_right.gif           |  Bin 0 -> 53 bytes
 .../css/smoothness/images/animated-overlay.gif  |  Bin 0 -> 1738 bytes
 .../dadada_40x100_textures_02_glass_75.png      |  Bin 0 -> 214 bytes
 .../e6e6e6_40x100_textures_02_glass_75.png      |  Bin 0 -> 211 bytes
 .../images/ffffff_40x100_textures_01_flat_0.png |  Bin 0 -> 178 bytes
 .../ffffff_40x100_textures_02_glass_65.png      |  Bin 0 -> 207 bytes
 .../images/ui-bg_flat_0_aaaaaa_40x100.png       |  Bin 0 -> 212 bytes
 .../images/ui-bg_flat_75_ffffff_40x100.png      |  Bin 0 -> 208 bytes
 .../images/ui-bg_glass_55_fbf9ee_1x400.png      |  Bin 0 -> 335 bytes
 .../images/ui-bg_glass_65_ffffff_1x400.png      |  Bin 0 -> 207 bytes
 .../images/ui-bg_glass_75_dadada_1x400.png      |  Bin 0 -> 262 bytes
 .../images/ui-bg_glass_75_e6e6e6_1x400.png      |  Bin 0 -> 262 bytes
 .../images/ui-bg_glass_95_fef1ec_1x400.png      |  Bin 0 -> 332 bytes
 .../ui-bg_highlight-soft_75_cccccc_1x100.png    |  Bin 0 -> 280 bytes
 .../images/ui-icons_222222_256x240.png          |  Bin 0 -> 6922 bytes
 .../images/ui-icons_2e83ff_256x240.png          |  Bin 0 -> 4549 bytes
 .../images/ui-icons_454545_256x240.png          |  Bin 0 -> 6992 bytes
 .../images/ui-icons_888888_256x240.png          |  Bin 0 -> 6999 bytes
 .../images/ui-icons_cd0a0a_256x240.png          |  Bin 0 -> 4549 bytes
 .../smoothness/jquery-ui-1.10.3.custom.min.css  |    7 +
 .../ui/css/smoothness/jqueryui-themeroller.css  |  856 +++
 .../themes/theme1/ui/custom-fonts/Read Me.txt   |    5 +
 .../theme1/ui/custom-fonts/fonts/stratos.eot    |  Bin 0 -> 6660 bytes
 .../theme1/ui/custom-fonts/fonts/stratos.svg    |   21 +
 .../theme1/ui/custom-fonts/fonts/stratos.ttf    |  Bin 0 -> 6496 bytes
 .../theme1/ui/custom-fonts/fonts/stratos.woff   |  Bin 0 -> 6572 bytes
 .../theme1/ui/custom-fonts/selection.json       |  268 +
 .../themes/theme1/ui/custom-fonts/style.css     |   58 +
 .../console/themes/theme1/ui/favicon.ico        |  Bin 0 -> 766 bytes
 .../ui/font-awesome/css/font-awesome-ie7.css    | 1203 ++++
 .../font-awesome/css/font-awesome-ie7.min.css   |  384 +
 .../theme1/ui/font-awesome/css/font-awesome.css | 1338 ++++
 .../ui/font-awesome/css/font-awesome.min.css    |    4 +
 .../theme1/ui/font-awesome/font/FontAwesome.otf |  Bin 0 -> 61896 bytes
 .../font-awesome/font/fontawesome-webfont.eot   |  Bin 0 -> 37405 bytes
 .../font-awesome/font/fontawesome-webfont.svg   |  399 +
 .../font-awesome/font/fontawesome-webfont.ttf   |  Bin 0 -> 79076 bytes
 .../font-awesome/font/fontawesome-webfont.woff  |  Bin 0 -> 43572 bytes
 .../ui/font-awesome/fonts/FontAwesome.otf       |  Bin 0 -> 62856 bytes
 .../font-awesome/fonts/fontawesome-webfont.eot  |  Bin 0 -> 38205 bytes
 .../font-awesome/fonts/fontawesome-webfont.svg  |  414 ++
 .../font-awesome/fonts/fontawesome-webfont.ttf  |  Bin 0 -> 80652 bytes
 .../font-awesome/fonts/fontawesome-webfont.woff |  Bin 0 -> 44432 bytes
 .../ui/fonts/glyphicons-halflings-regular.eot   |  Bin 0 -> 14079 bytes
 .../ui/fonts/glyphicons-halflings-regular.svg   |  228 +
 .../ui/fonts/glyphicons-halflings-regular.ttf   |  Bin 0 -> 29512 bytes
 .../ui/fonts/glyphicons-halflings-regular.woff  |  Bin 0 -> 16448 bytes
 .../console/themes/theme1/ui/fonts/stratos.eot  |  Bin 0 -> 6316 bytes
 .../console/themes/theme1/ui/fonts/stratos.svg  |   20 +
 .../console/themes/theme1/ui/fonts/stratos.ttf  |  Bin 0 -> 6152 bytes
 .../console/themes/theme1/ui/fonts/stratos.woff |  Bin 0 -> 6228 bytes
 .../console/themes/theme1/ui/img/clouds.png     |  Bin 0 -> 6663 bytes
 .../console/themes/theme1/ui/img/egg-logo.png   |  Bin 0 -> 8299 bytes
 .../console/themes/theme1/ui/img/gray.png       |  Bin 0 -> 144 bytes
 .../console/themes/theme1/ui/img/icon-lock.png  |  Bin 0 -> 337 bytes
 .../console/themes/theme1/ui/img/icon-user.png  |  Bin 0 -> 447 bytes
 .../themes/theme1/ui/img/login-shadow.png       |  Bin 0 -> 1214 bytes
 .../themes/theme1/ui/img/logo-inside.png        |  Bin 0 -> 7563 bytes
 .../console/themes/theme1/ui/img/logo-login.png |  Bin 0 -> 6223 bytes
 .../console/themes/theme1/ui/img/repeat.png     |  Bin 0 -> 7371 bytes
 .../themes/theme1/ui/img/transparent-white.png  |  Bin 0 -> 144 bytes
 .../themes/theme1/ui/js/configure_stratos.js    |   38 +
 .../console/themes/theme1/ui/js/main.js         |    1 +
 .../console/themes/theme1/ui/js/utils.js        |   21 +
 .../themes/theme1/ui/js/vendor/bootstrap.js     | 1999 +++++
 .../themes/theme1/ui/js/vendor/bootstrap.min.js |    6 +
 .../theme1/ui/js/vendor/jquery-1.10.1.min.js    |    6 +
 .../ui/js/vendor/jquery-ui-1.10.3.custom.min.js |    6 +
 .../theme1/ui/js/vendor/jquery.validate.min.js  |    2 +
 .../vendor/modernizr-2.6.2-respond-1.1.0.min.js |   11 +
 .../themes/theme1/ui/js/vendor/raphael-min.js   |   11 +
 .../console/util/utility.jag                    |  150 +
 .../controllers/README                          |    1 -
 .../controllers/acs.jag                         |   93 -
 .../controllers/login.jag                       |   37 -
 .../controllers/logout.jag                      |   41 -
 .../controllers/payloadFactory.jag              |   50 -
 .../controllers/profileClient.jag               |   58 -
 .../data/cartridge_deployments.json             |   10 -
 .../data/cartridges.json                        |   35 -
 .../data/config_status.json                     |    4 -
 .../data/lbs.json                               |   10 -
 .../data/mt_service_deployments.json            |   10 -
 .../data/mycartridges.json                      |   35 -
 .../data/partition_deployments.json             |   10 -
 .../data/policy_deployments.json                |   10 -
 .../index.jag                                   |    7 -
 .../jaggery.conf                                |    3 -
 .../js/dialog.js                                |  369 -
 .../js/main.js                                  |   19 -
 .../org.apache.stratos.manager.console/lbs.jag  |    9 -
 .../login.jag                                   |    5 -
 .../modules/README                              |    1 -
 .../mt_service_deployments.jag                  |    9 -
 .../partition_deployments.jag                   |    9 -
 .../policy_deployments.jag                      |    9 -
 .../org.apache.stratos.manager.console/root-js  |  369 -
 .../sso/views/login.jag                         |  128 +
 .../stratos-resources/css/bootstrap-missing.css |  995 +++
 .../stratos-resources/css/bootstrap-theme.css   |  404 ++
 .../views/stratos-resources/css/bootstrap.css   | 6805 ++++++++++++++++++
 .../sso/views/stratos-resources/css/main.css    |  146 +
 .../sso/views/stratos-resources/img/clouds.png  |  Bin 0 -> 6663 bytes
 .../views/stratos-resources/img/egg-logo.png    |  Bin 0 -> 8299 bytes
 .../sso/views/stratos-resources/img/gray.png    |  Bin 0 -> 144 bytes
 .../views/stratos-resources/img/icon-lock.png   |  Bin 0 -> 337 bytes
 .../views/stratos-resources/img/icon-user.png   |  Bin 0 -> 447 bytes
 .../stratos-resources/img/login-shadow.png      |  Bin 0 -> 1214 bytes
 .../views/stratos-resources/img/logo-inside.png |  Bin 0 -> 7563 bytes
 .../views/stratos-resources/img/logo-login.png  |  Bin 0 -> 6223 bytes
 .../sso/views/stratos-resources/img/repeat.png  |  Bin 0 -> 7371 bytes
 .../stratos-resources/img/transparent-white.png |  Bin 0 -> 144 bytes
 .../subscribe_cartridge.jag                     |    6 -
 .../themes/README                               |    1 -
 .../themes/theme1/pages/index.hbs               |   78 -
 .../theme1/partials/cartridge_deployments.hbs   |   90 -
 .../themes/theme1/partials/cartridges.hbs       |   37 -
 .../theme1/partials/configure_stratos.hbs       |   48 -
 .../themes/theme1/partials/header.hbs           |  105 -
 .../themes/theme1/partials/lbs.hbs              |   90 -
 .../themes/theme1/partials/login.hbs            |   31 -
 .../theme1/partials/mt_service_deployments.hbs  |   90 -
 .../themes/theme1/partials/mycartridges.hbs     |    7 -
 .../theme1/partials/partition_deployments.hbs   |  129 -
 .../theme1/partials/policy_deployments.hbs      |   90 -
 .../theme1/partials/subscribe_cartridge.hbs     |  125 -
 .../themes/theme1/partials/title.hbs            |    1 -
 .../themes/theme1/renderers/account_recovery.js |   23 -
 .../theme1/renderers/cartridge_deployments.js   |   47 -
 .../themes/theme1/renderers/cartridges.js       |   72 -
 .../theme1/renderers/configure_stratos.js       |   42 -
 .../themes/theme1/renderers/index.js            |   68 -
 .../themes/theme1/renderers/lbs.js              |   47 -
 .../themes/theme1/renderers/login.js            |   22 -
 .../theme1/renderers/mt_service_deployments.js  |   47 -
 .../theme1/renderers/partition_deployments.js   |   47 -
 .../theme1/renderers/policy_deployments.js      |   47 -
 .../theme1/renderers/subscribe_cartridge.js     |   37 -
 .../themes/theme1/theme.js                      |    1 -
 .../themes/theme1/ui/404.html                   |  157 -
 .../ui/apple-touch-icon-114x114-precomposed.png |  Bin 1189 -> 0 bytes
 .../ui/apple-touch-icon-144x144-precomposed.png |  Bin 1475 -> 0 bytes
 .../ui/apple-touch-icon-57x57-precomposed.png   |  Bin 730 -> 0 bytes
 .../ui/apple-touch-icon-72x72-precomposed.png   |  Bin 854 -> 0 bytes
 .../theme1/ui/apple-touch-icon-precomposed.png  |  Bin 730 -> 0 bytes
 .../themes/theme1/ui/apple-touch-icon.png       |  Bin 730 -> 0 bytes
 .../themes/theme1/ui/crossdomain.xml            |   15 -
 .../themes/theme1/ui/css/bootstrap-missing.css  |  995 ---
 .../themes/theme1/ui/css/bootstrap-theme.css    |  404 --
 .../theme1/ui/css/bootstrap-theme.min.css       |    1 -
 .../themes/theme1/ui/css/bootstrap.css          | 6805 ------------------
 .../themes/theme1/ui/css/bootstrap.min.css      |    9 -
 .../themes/theme1/ui/css/dialog.css             |  128 -
 .../themes/theme1/ui/css/main.css               |  363 -
 .../images/222222_11x11_icon_close.gif          |  Bin 62 -> 0 bytes
 .../images/222222_11x11_icon_resize_se.gif      |  Bin 61 -> 0 bytes
 .../smoothness/images/222222_7x7_arrow_left.gif |  Bin 53 -> 0 bytes
 .../images/222222_7x7_arrow_right.gif           |  Bin 53 -> 0 bytes
 .../images/454545_11x11_icon_close.gif          |  Bin 62 -> 0 bytes
 .../smoothness/images/454545_7x7_arrow_left.gif |  Bin 53 -> 0 bytes
 .../images/454545_7x7_arrow_right.gif           |  Bin 53 -> 0 bytes
 .../images/888888_11x11_icon_close.gif          |  Bin 62 -> 0 bytes
 .../smoothness/images/888888_7x7_arrow_left.gif |  Bin 53 -> 0 bytes
 .../images/888888_7x7_arrow_right.gif           |  Bin 53 -> 0 bytes
 .../css/smoothness/images/animated-overlay.gif  |  Bin 1738 -> 0 bytes
 .../dadada_40x100_textures_02_glass_75.png      |  Bin 214 -> 0 bytes
 .../e6e6e6_40x100_textures_02_glass_75.png      |  Bin 211 -> 0 bytes
 .../images/ffffff_40x100_textures_01_flat_0.png |  Bin 178 -> 0 bytes
 .../ffffff_40x100_textures_02_glass_65.png      |  Bin 207 -> 0 bytes
 .../images/ui-bg_flat_0_aaaaaa_40x100.png       |  Bin 212 -> 0 bytes
 .../images/ui-bg_flat_75_ffffff_40x100.png      |  Bin 208 -> 0 bytes
 .../images/ui-bg_glass_55_fbf9ee_1x400.png      |  Bin 335 -> 0 bytes
 .../images/ui-bg_glass_65_ffffff_1x400.png      |  Bin 207 -> 0 bytes
 .../images/ui-bg_glass_75_dadada_1x400.png      |  Bin 262 -> 0 bytes
 .../images/ui-bg_glass_75_e6e6e6_1x400.png      |  Bin 262 -> 0 bytes
 .../images/ui-bg_glass_95_fef1ec_1x400.png      |  Bin 332 -> 0 bytes
 .../ui-bg_highlight-soft_75_cccccc_1x100.png    |  Bin 280 -> 0 bytes
 .../images/ui-icons_222222_256x240.png          |  Bin 6922 -> 0 bytes
 .../images/ui-icons_2e83ff_256x240.png          |  Bin 4549 -> 0 bytes
 .../images/ui-icons_454545_256x240.png          |  Bin 6992 -> 0 bytes
 .../images/ui-icons_888888_256x240.png          |  Bin 6999 -> 0 bytes
 .../images/ui-icons_cd0a0a_256x240.png          |  Bin 4549 -> 0 bytes
 .../smoothness/jquery-ui-1.10.3.custom.min.css  |    7 -
 .../ui/css/smoothness/jqueryui-themeroller.css  |  856 ---
 .../themes/theme1/ui/custom-fonts/Read Me.txt   |    5 -
 .../theme1/ui/custom-fonts/fonts/stratos.eot    |  Bin 6660 -> 0 bytes
 .../theme1/ui/custom-fonts/fonts/stratos.svg    |   21 -
 .../theme1/ui/custom-fonts/fonts/stratos.ttf    |  Bin 6496 -> 0 bytes
 .../theme1/ui/custom-fonts/fonts/stratos.woff   |  Bin 6572 -> 0 bytes
 .../theme1/ui/custom-fonts/selection.json       |  268 -
 .../themes/theme1/ui/custom-fonts/style.css     |   58 -
 .../themes/theme1/ui/favicon.ico                |  Bin 766 -> 0 bytes
 .../ui/font-awesome/css/font-awesome-ie7.css    | 1203 ----
 .../font-awesome/css/font-awesome-ie7.min.css   |  384 -
 .../theme1/ui/font-awesome/css/font-awesome.css | 1338 ----
 .../ui/font-awesome/css/font-awesome.min.css    |    4 -
 .../theme1/ui/font-awesome/font/FontAwesome.otf |  Bin 61896 -> 0 bytes
 .../font-awesome/font/fontawesome-webfont.eot   |  Bin 37405 -> 0 bytes
 .../font-awesome/font/fontawesome-webfont.svg   |  399 -
 .../font-awesome/font/fontawesome-webfont.ttf   |  Bin 79076 -> 0 bytes
 .../font-awesome/font/fontawesome-webfont.woff  |  Bin 43572 -> 0 bytes
 .../ui/font-awesome/fonts/FontAwesome.otf       |  Bin 62856 -> 0 bytes
 .../font-awesome/fonts/fontawesome-webfont.eot  |  Bin 38205 -> 0 bytes
 .../font-awesome/fonts/fontawesome-webfont.svg  |  414 --
 .../font-awesome/fonts/fontawesome-webfont.ttf  |  Bin 80652 -> 0 bytes
 .../font-awesome/fonts/fontawesome-webfont.woff |  Bin 44432 -> 0 bytes
 .../ui/fonts/glyphicons-halflings-regular.eot   |  Bin 14079 -> 0 bytes
 .../ui/fonts/glyphicons-halflings-regular.svg   |  228 -
 .../ui/fonts/glyphicons-halflings-regular.ttf   |  Bin 29512 -> 0 bytes
 .../ui/fonts/glyphicons-halflings-regular.woff  |  Bin 16448 -> 0 bytes
 .../themes/theme1/ui/fonts/stratos.eot          |  Bin 6316 -> 0 bytes
 .../themes/theme1/ui/fonts/stratos.svg          |   20 -
 .../themes/theme1/ui/fonts/stratos.ttf          |  Bin 6152 -> 0 bytes
 .../themes/theme1/ui/fonts/stratos.woff         |  Bin 6228 -> 0 bytes
 .../themes/theme1/ui/img/clouds.png             |  Bin 6663 -> 0 bytes
 .../themes/theme1/ui/img/egg-logo.png           |  Bin 8299 -> 0 bytes
 .../themes/theme1/ui/img/gray.png               |  Bin 144 -> 0 bytes
 .../themes/theme1/ui/img/icon-lock.png          |  Bin 337 -> 0 bytes
 .../themes/theme1/ui/img/icon-user.png          |  Bin 447 -> 0 bytes
 .../themes/theme1/ui/img/login-shadow.png       |  Bin 1214 -> 0 bytes
 .../themes/theme1/ui/img/logo-inside.png        |  Bin 7563 -> 0 bytes
 .../themes/theme1/ui/img/logo-login.png         |  Bin 6223 -> 0 bytes
 .../themes/theme1/ui/img/repeat.png             |  Bin 7371 -> 0 bytes
 .../themes/theme1/ui/img/transparent-white.png  |  Bin 144 -> 0 bytes
 .../themes/theme1/ui/js/configure_stratos.js    |   38 -
 .../themes/theme1/ui/js/main.js                 |    1 -
 .../themes/theme1/ui/js/utils.js                |   21 -
 .../themes/theme1/ui/js/vendor/bootstrap.js     | 1999 -----
 .../themes/theme1/ui/js/vendor/bootstrap.min.js |    6 -
 .../theme1/ui/js/vendor/jquery-1.10.1.min.js    |    6 -
 .../ui/js/vendor/jquery-ui-1.10.3.custom.min.js |    6 -
 .../theme1/ui/js/vendor/jquery.validate.min.js  |    2 -
 .../vendor/modernizr-2.6.2-respond-1.1.0.min.js |   11 -
 .../themes/theme1/ui/js/vendor/raphael-min.js   |   11 -
 .../util/utility.jag                            |  146 -
 .../stratos/manager/deploy/service/Service.java |   56 +-
 .../service/ServiceDeploymentManager.java       |  142 +-
 .../service/multitenant/MultiTenantService.java |    7 +-
 .../multitenant/lb/MultiTenantLBService.java    |   49 +
 .../ServiceAlreadyDeployedException.java        |   49 +
 .../listener/InstanceStatusListener.java        |   15 +-
 .../manager/CartridgeSubscriptionManager.java   |    8 +-
 .../publisher/ArtifactUpdatePublisher.java      |   65 -
 .../InstanceNotificationPublisher.java          |   81 +
 .../publisher/TenantSynzhronizerTask.java       |   12 +-
 .../InstanceCleanupNotificationService.java     |   42 +
 .../service/RepoNotificationService.java        |  179 +-
 .../SubscriptionMultiTenantBehaviour.java       |    6 +-
 .../src/main/resources/META-INF/services.xml    |   18 +
 .../health/stat/AverageLoadAverageEvent.java    |    8 +-
 .../notifier/InstanceCleanupClusterEvent.java   |   38 +
 .../instance/notifier/InstanceCleanupEvent.java |   47 -
 .../notifier/InstanceCleanupMemberEvent.java    |   38 +
 .../event/topology/ClusterRemovedEvent.java     |   10 +-
 .../InstanceCleanupClusterEventListener.java    |   24 +
 .../notifier/InstanceCleanupEventListener.java  |   25 -
 .../InstanceCleanupMemberEventListener.java     |   25 +
 .../GradientOfLoadAverageMessageProcessor.java  |    6 +-
 ...InstanceCleanupNotifierMessageProcessor.java |    6 +-
 .../InstanceNotifierMessageProcessorChain.java  |    4 +-
 .../org.apache.stratos.rest.endpoint/pom.xml    |    2 +-
 .../stratos/rest/endpoint/mock/MockContext.java |  131 +-
 .../rest/endpoint/mock/StratosTestAdmin.java    |  203 +-
 .../rest/endpoint/services/ServiceUtils.java    |   28 +-
 .../rest/endpoint/services/StratosAdmin.java    |   14 +-
 .../AverageInFlightRequestsEventFormatter.xml   |    2 +-
 .../AverageLoadAverageEventFormatter.xml        |    2 +-
 .../AverageMemoryConsumptionEventFormatter.xml  |    2 +-
 .../FaultMessageEventFormatter.xml              |    2 +-
 .../GradientInFlightRequestsEventFormatter.xml  |    2 +-
 .../GradientLoadAverageEventFormatter.xml       |    2 +-
 .../GradientMemoryConsumptionEventFormatter.xml |    2 +-
 .../MemberAverageLoadAverageEventFormatter.xml  |    2 +-
 ...erAverageMemoryConsumptionEventFormatter.xml |    2 +-
 .../MemberGradientLoadAverageEventFormatter.xml |    2 +-
 ...rGradientMemoryConsumptionEventFormatter.xml |    2 +-
 ...econdDerivativeLoadAverageEventFormatter.xml |    2 +-
 ...erivativeMemoryConsumptionEventFormatter.xml |    2 +-
 ...DerivativeInFlightRequestsEventFormatter.xml |    2 +-
 ...econdDerivativeLoadAverageEventFormatter.xml |    2 +-
 ...erivativeMemoryConsumptionEventFormatter.xml |    2 +-
 .../pom.xml                                     |    1 +
 .../distribution/src/main/conf/autoscaler.xml   |    5 +
 .../distribution/src/main/conf/mincheck.drl     |    2 +-
 .../distribution/src/main/conf/scaling.drl      |   52 +-
 .../distribution/src/main/extensions/clean.sh   |   27 +
 .../modules/distribution/src/assembly/bin.xml   |   29 +-
 .../distribution/src/main/conf/axis2.xml        |  702 ++
 .../modules/p2-profile-gen/pom.xml              |   58 +-
 products/stratos-manager/pom.xml                |    4 +
 .../pom.xml                                     |  141 +
 .../InstanceCleanupNotificationService.wsdl     |   91 +
 service-stubs/pom.xml                           |    1 +
 tools/puppet/manifests/classes/lb_cartridge.pp  |  133 +
 tools/puppet/manifests/classes/stratos.pp       |   92 +
 tools/puppet/manifests/nodes.pp                 |   29 +
 tools/puppet/templates/load-balancer/.erb       |    0
 406 files changed, 30419 insertions(+), 19815 deletions(-)
----------------------------------------------------------------------



[2/4] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos

Posted by is...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/c5f5cbf4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/c5f5cbf4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/c5f5cbf4

Branch: refs/heads/master
Commit: c5f5cbf478dae8ecd1d6d15a137fcdabdb1e2e8e
Parents: 6cb59f6 0529464
Author: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
Authored: Thu Jan 9 15:10:00 2014 +0530
Committer: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
Committed: Thu Jan 9 15:10:00 2014 +0530

----------------------------------------------------------------------
 .../stratos/cartridge/agent/CartridgeAgent.java |   9 ++
 .../config/CartridgeAgentConfiguration.java     |   2 +-
 .../instance/notifier/InstanceCleanupEvent.java |   7 +-
 tools/stratos-installer/resources/userstore.sql | 108 ++++++++++++++++---
 4 files changed, 106 insertions(+), 20 deletions(-)
----------------------------------------------------------------------



Re: [1/4] git commit: Updated stratos.sh (source: wso2server.sh from WSO2 Carbon 4.2.0)

Posted by Isuru Perera <is...@wso2.com>.
Hi Lahiru,

Sorry, I updated this stratos.sh as discussed earlier in dev@ [1].

It's good that you added it back! :)

Thanks!

Best Regards,

[1]
http://mail-archives.apache.org/mod_mbox/stratos-dev/201401.mbox/%3CCADQ5vQSVy%3DAnjR1W%2BA7UrZ5JX8q9acsru3DSVGR%3D-bLbXX7ODg%40mail.gmail.com%3E


On Wed, Jan 15, 2014 at 1:02 PM, Lahiru Sandaruwan <la...@wso2.com> wrote:

> Hi Isuru,
>
> Seems following line is removed from loadbalancer startup script. This
> cause errors while starting...
>
>
> -Dloadbalancer.conf.file="$CARBON_HOME/repository/conf/loadbalancer.conf" \
>
>
> On Mon, Jan 13, 2014 at 9:28 AM, <is...@apache.org> wrote:
>
>> Updated Branches:
>>   refs/heads/master f8605c956 -> 8adffee23
>>
>>
>> Updated stratos.sh (source: wso2server.sh from WSO2 Carbon 4.2.0)
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
>> Commit:
>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/6cb59f64
>> Tree:
>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/6cb59f64
>> Diff:
>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/6cb59f64
>>
>> Branch: refs/heads/master
>> Commit: 6cb59f64b8103b7efc91e8c0cb58b347f9b9991a
>> Parents: b3420b3
>> Author: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
>> Authored: Thu Jan 9 15:08:32 2014 +0530
>> Committer: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
>> Committed: Thu Jan 9 15:09:34 2014 +0530
>>
>> ----------------------------------------------------------------------
>>  .../distribution/src/main/resources/stratos.sh  | 122 ++++++++-------
>>  .../distribution/src/main/resources/stratos.sh  | 123 ++++++++-------
>>  .../distribution/src/main/bin/stratos.sh        | 151 ++++++++++---------
>>  .../modules/distribution/src/bin/stratos.sh     |  41 ++---
>>  .../stratos-installer/config/cc/bin/stratos.sh  | 121 ++++++++-------
>>  5 files changed, 295 insertions(+), 263 deletions(-)
>> ----------------------------------------------------------------------
>>
>>
>>
>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
>> ----------------------------------------------------------------------
>> diff --git
>> a/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
>> b/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
>> index 0232137..77f7a91 100644
>> ---
>> a/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
>> +++
>> b/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
>> @@ -1,27 +1,29 @@
>>  #!/bin/sh
>>  #
>> ----------------------------------------------------------------------------
>> -# 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
>> +#  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
>> +#      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.
>> -
>> +#  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.
>>  #
>> ----------------------------------------------------------------------------
>> -# Main Script for the Apache Stratos
>> +# Main Script for the Apache Stratos (incubating)
>>  #
>>  # Environment Variable Prerequisites
>>  #
>> +#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will
>>  try
>> +#                   to figure it out.
>> +#
>>  #   JAVA_HOME       Must point at your Java Development Kit installation.
>>  #
>>  #   JAVA_OPTS       (Optional) Java runtime options used when the
>> commands
>> @@ -31,6 +33,7 @@
>>  #
>> -----------------------------------------------------------------------------
>>
>>  # OS specific support.  $var _must_ be set to either true or false.
>> +#ulimit -n 100000
>>
>>  cygwin=false;
>>  darwin=false;
>> @@ -130,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
>>    exit 1
>>  fi
>>
>> +if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>> +  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
>> +fi
>> +
>>  # ----- Process the input command
>> ----------------------------------------------
>> +args=""
>>  for c in $*
>>  do
>>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug"
>> ]; then
>> @@ -140,29 +148,18 @@ do
>>            if [ -z "$PORT" ]; then
>>                  PORT=$c
>>            fi
>> -    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
>> -          CMD="--n"
>> -          continue
>> -    elif [ "$CMD" = "--n" ]; then
>> -          if [ -z "$INSTANCES" ]; then
>> -                INSTANCES=$c
>> -          fi
>>      elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ];
>> then
>>            CMD="stop"
>>      elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start"
>> ]; then
>>            CMD="start"
>> -    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" =
>> "console" ]; then
>> -          CMD="console"
>>      elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" =
>> "version" ]; then
>>            CMD="version"
>>      elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" =
>> "restart" ]; then
>>            CMD="restart"
>> -    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ];
>> then
>> -          CMD="dump"
>>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
>> then
>>            CMD="test"
>> -    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" =
>> "status" ]; then
>> -          CMD="status"
>> +    else
>> +        args="$args $c"
>>      fi
>>  done
>>
>> @@ -177,23 +174,35 @@ if [ "$CMD" = "--debug" ]; then
>>    CMD="RUN"
>>    JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE
>> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
>>    echo "Please start the remote debugging client to continue..."
>> -elif [ "$CMD" = "--n" ]; then
>> -  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed
>> 's/[0-9]//g'` ]]; then
>> -    echo " Please specify the number of instances to start after the --n
>> option"
>> -    exit 1
>> -  fi
>>  elif [ "$CMD" = "start" ]; then
>> +  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>> +    if  ps -p $PID >&- ; then
>> +      echo "Process is already running"
>> +      exit 0
>> +    fi
>> +  fi
>>    export CARBON_HOME=$CARBON_HOME
>> -  nohup $CARBON_HOME/bin/stratos.sh &
>> +# using nohup bash to avoid erros in solaris OS.TODO
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "stop" ]; then
>>    export CARBON_HOME=$CARBON_HOME
>> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
>> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>>    exit 0
>>  elif [ "$CMD" = "restart" ]; then
>>    export CARBON_HOME=$CARBON_HOME
>> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
>> -  nohup $CARBON_HOME/bin/stratos.sh &
>> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>> +  process_status=0
>> +  pid=`cat $CARBON_HOME/wso2carbon.pid`
>> +  while [ "$process_status" -eq "0" ]
>> +  do
>> +        sleep 1;
>> +        ps -p$pid 2>&1 > /dev/null
>> +        process_status=$?
>> +  done
>> +
>> +# using nohup bash to avoid erros in solaris OS.TODO
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "test" ]; then
>>      JAVACMD="exec "$JAVACMD""
>> @@ -230,7 +239,10 @@ do
>>          CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
>>      fi
>>  done
>> -
>> +for t in "$CARBON_HOME"/lib/commons-lang*.jar
>> +do
>> +    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
>> +done
>>  # For Cygwin, switch paths to Windows format before running java
>>  if $cygwin; then
>>    JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
>> @@ -252,25 +264,18 @@ cd "$CARBON_HOME"
>>  START_EXIT_STATUS=121
>>  status=$START_EXIT_STATUS
>>
>> +#To monitor a Carbon server in remote JMX mode on linux host machines,
>> set the below system property.
>> +#   -Djava.rmi.server.hostname="your.IP.goes.here"
>> +
>>  while [ "$status" = "$START_EXIT_STATUS" ]
>>  do
>>      $JAVACMD \
>> -     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>> -     -d64 \
>> -     -server \
>> -     -Xms1500m -Xmx3000m \
>> -     -XX:PermSize=256m -XX:MaxPermSize=512m \
>> -     -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
>> -     -XX:+CMSClassUnloadingEnabled \
>> -     -XX:+OptimizeStringConcat \
>> -     -XX:+HeapDumpOnOutOfMemoryError \
>> -     -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
>> -     -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
>> -     -XX:ErrorFile=repository/logs/hs_err_pid.log \
>> -     -XX:OnError="nohup ./stratos.sh &" \
>> +    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>> +    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
>> +    -server \
>> +    -XX:+HeapDumpOnOutOfMemoryError \
>> +    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
>>      $JAVA_OPTS \
>> -    -DandesConfig=qpid-config.xml \
>> -    -Ddisable.cassandra.server.startup=true \
>>      -Dcom.sun.management.jmxremote \
>>      -classpath "$CARBON_CLASSPATH" \
>>      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
>> @@ -280,17 +285,20 @@ do
>>      -Dcarbon.registry.root=/ \
>>      -Djava.command="$JAVACMD" \
>>      -Dcarbon.home="$CARBON_HOME" \
>> -
>>  -Dwso2.transports.xml="$CARBON_HOME/repository/conf/mgt-transports.xml" \
>> -
>>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties"
>> \
>> +    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>>      -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
>> -    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>> +
>>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
>> \
>>      -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
>> +    -Dconf.location="$CARBON_HOME/repository/conf"\
>>
>>  -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
>>      -Dcom.atomikos.icatch.hide_init_file_path=true \
>>      -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
>>      -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
>>      -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
>>      -Dorg.terracotta.quartz.skipUpdateCheck=true \
>> +    -Djava.security.egd=file:/dev/./urandom \
>> +    -Dfile.encoding=UTF8 \
>> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>>      org.wso2.carbon.bootstrap.Bootstrap $*
>>      status=$?
>>  done
>>
>>
>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
>> ----------------------------------------------------------------------
>> diff --git
>> a/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
>> b/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
>> index 2a5176e..77f7a91 100644
>> ---
>> a/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
>> +++
>> b/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
>> @@ -1,27 +1,29 @@
>>  #!/bin/sh
>>  #
>> ----------------------------------------------------------------------------
>> -# 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
>> +#  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
>> +#      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.
>> -
>> +#  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.
>>  #
>> ----------------------------------------------------------------------------
>> -# Main Script for the Apache Stratos
>> +# Main Script for the Apache Stratos (incubating)
>>  #
>>  # Environment Variable Prerequisites
>>  #
>> +#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will
>>  try
>> +#                   to figure it out.
>> +#
>>  #   JAVA_HOME       Must point at your Java Development Kit installation.
>>  #
>>  #   JAVA_OPTS       (Optional) Java runtime options used when the
>> commands
>> @@ -31,6 +33,7 @@
>>  #
>> -----------------------------------------------------------------------------
>>
>>  # OS specific support.  $var _must_ be set to either true or false.
>> +#ulimit -n 100000
>>
>>  cygwin=false;
>>  darwin=false;
>> @@ -130,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
>>    exit 1
>>  fi
>>
>> +if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>> +  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
>> +fi
>> +
>>  # ----- Process the input command
>> ----------------------------------------------
>> +args=""
>>  for c in $*
>>  do
>>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug"
>> ]; then
>> @@ -140,29 +148,18 @@ do
>>            if [ -z "$PORT" ]; then
>>                  PORT=$c
>>            fi
>> -    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
>> -          CMD="--n"
>> -          continue
>> -    elif [ "$CMD" = "--n" ]; then
>> -          if [ -z "$INSTANCES" ]; then
>> -                INSTANCES=$c
>> -          fi
>>      elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ];
>> then
>>            CMD="stop"
>>      elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start"
>> ]; then
>>            CMD="start"
>> -    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" =
>> "console" ]; then
>> -          CMD="console"
>>      elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" =
>> "version" ]; then
>>            CMD="version"
>>      elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" =
>> "restart" ]; then
>>            CMD="restart"
>> -    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ];
>> then
>> -          CMD="dump"
>>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
>> then
>>            CMD="test"
>> -    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" =
>> "status" ]; then
>> -          CMD="status"
>> +    else
>> +        args="$args $c"
>>      fi
>>  done
>>
>> @@ -177,23 +174,35 @@ if [ "$CMD" = "--debug" ]; then
>>    CMD="RUN"
>>    JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE
>> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
>>    echo "Please start the remote debugging client to continue..."
>> -elif [ "$CMD" = "--n" ]; then
>> -  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed
>> 's/[0-9]//g'` ]]; then
>> -    echo " Please specify the number of instances to start after the --n
>> option"
>> -    exit 1
>> -  fi
>>  elif [ "$CMD" = "start" ]; then
>> +  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>> +    if  ps -p $PID >&- ; then
>> +      echo "Process is already running"
>> +      exit 0
>> +    fi
>> +  fi
>>    export CARBON_HOME=$CARBON_HOME
>> -  nohup $CARBON_HOME/bin/stratos.sh &
>> +# using nohup bash to avoid erros in solaris OS.TODO
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "stop" ]; then
>>    export CARBON_HOME=$CARBON_HOME
>> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
>> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>>    exit 0
>>  elif [ "$CMD" = "restart" ]; then
>>    export CARBON_HOME=$CARBON_HOME
>> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
>> -  nohup $CARBON_HOME/bin/stratos.sh &
>> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>> +  process_status=0
>> +  pid=`cat $CARBON_HOME/wso2carbon.pid`
>> +  while [ "$process_status" -eq "0" ]
>> +  do
>> +        sleep 1;
>> +        ps -p$pid 2>&1 > /dev/null
>> +        process_status=$?
>> +  done
>> +
>> +# using nohup bash to avoid erros in solaris OS.TODO
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "test" ]; then
>>      JAVACMD="exec "$JAVACMD""
>> @@ -230,7 +239,10 @@ do
>>          CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
>>      fi
>>  done
>> -
>> +for t in "$CARBON_HOME"/lib/commons-lang*.jar
>> +do
>> +    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
>> +done
>>  # For Cygwin, switch paths to Windows format before running java
>>  if $cygwin; then
>>    JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
>> @@ -252,25 +264,18 @@ cd "$CARBON_HOME"
>>  START_EXIT_STATUS=121
>>  status=$START_EXIT_STATUS
>>
>> +#To monitor a Carbon server in remote JMX mode on linux host machines,
>> set the below system property.
>> +#   -Djava.rmi.server.hostname="your.IP.goes.here"
>> +
>>  while [ "$status" = "$START_EXIT_STATUS" ]
>>  do
>>      $JAVACMD \
>> -     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>> -     -d64 \
>> -     -server \
>> -     -Xms1500m -Xmx3000m \
>> -     -XX:PermSize=256m -XX:MaxPermSize=512m \
>> -     -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
>> -     -XX:+CMSClassUnloadingEnabled \
>> -     -XX:+OptimizeStringConcat \
>> -     -XX:+HeapDumpOnOutOfMemoryError \
>> -     -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
>> -     -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
>> -     -XX:ErrorFile=repository/logs/hs_err_pid.log \
>> -     -XX:OnError="nohup ./stratos.sh &" \
>> +    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>> +    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
>> +    -server \
>> +    -XX:+HeapDumpOnOutOfMemoryError \
>> +    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
>>      $JAVA_OPTS \
>> -    -DandesConfig=qpid-config.xml \
>> -    -Ddisable.cassandra.server.startup=true \
>>      -Dcom.sun.management.jmxremote \
>>      -classpath "$CARBON_CLASSPATH" \
>>      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
>> @@ -280,18 +285,20 @@ do
>>      -Dcarbon.registry.root=/ \
>>      -Djava.command="$JAVACMD" \
>>      -Dcarbon.home="$CARBON_HOME" \
>> -
>>  -Dwso2.transports.xml="$CARBON_HOME/repository/conf/mgt-transports.xml" \
>> -
>>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties"
>> \
>> +    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>>      -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
>> -    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>> +
>>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
>> \
>>      -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
>> +    -Dconf.location="$CARBON_HOME/repository/conf"\
>>
>>  -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
>>      -Dcom.atomikos.icatch.hide_init_file_path=true \
>>      -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
>> -    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>>      -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
>>      -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
>>      -Dorg.terracotta.quartz.skipUpdateCheck=true \
>> +    -Djava.security.egd=file:/dev/./urandom \
>> +    -Dfile.encoding=UTF8 \
>> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>>      org.wso2.carbon.bootstrap.Bootstrap $*
>>      status=$?
>>  done
>>
>>
>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
>> ----------------------------------------------------------------------
>> diff --git
>> a/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
>> b/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
>> index 7d8f2f1..77f7a91 100644
>> --- a/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
>> +++ b/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
>> @@ -17,19 +17,23 @@
>>  #  specific language governing permissions and limitations
>>  #  under the License.
>>  #
>> ----------------------------------------------------------------------------
>> -#  Main Script for the Apache Stratos
>> +# Main Script for the Apache Stratos (incubating)
>>  #
>> -#  Environment Variable Prerequisites
>> +# Environment Variable Prerequisites
>> +#
>> +#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will
>>  try
>> +#                   to figure it out.
>>  #
>>  #   JAVA_HOME       Must point at your Java Development Kit installation.
>>  #
>>  #   JAVA_OPTS       (Optional) Java runtime options used when the
>> commands
>>  #                   is executed.
>>  #
>> -#  NOTE: Borrowed generously from Apache Tomcat startup scripts.
>> +# NOTE: Borrowed generously from Apache Tomcat startup scripts.
>>  #
>> -----------------------------------------------------------------------------
>>
>>  # OS specific support.  $var _must_ be set to either true or false.
>> +#ulimit -n 100000
>>
>>  cygwin=false;
>>  darwin=false;
>> @@ -129,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
>>    exit 1
>>  fi
>>
>> +if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>> +  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
>> +fi
>> +
>>  # ----- Process the input command
>> ----------------------------------------------
>> +args=""
>>  for c in $*
>>  do
>>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug"
>> ]; then
>> @@ -139,29 +148,18 @@ do
>>            if [ -z "$PORT" ]; then
>>                  PORT=$c
>>            fi
>> -    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
>> -          CMD="--n"
>> -          continue
>> -    elif [ "$CMD" = "--n" ]; then
>> -          if [ -z "$INSTANCES" ]; then
>> -                INSTANCES=$c
>> -          fi
>>      elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ];
>> then
>>            CMD="stop"
>>      elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start"
>> ]; then
>>            CMD="start"
>> -    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" =
>> "console" ]; then
>> -          CMD="console"
>>      elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" =
>> "version" ]; then
>>            CMD="version"
>>      elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" =
>> "restart" ]; then
>>            CMD="restart"
>> -    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ];
>> then
>> -          CMD="dump"
>>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
>> then
>>            CMD="test"
>> -    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" =
>> "status" ]; then
>> -          CMD="status"
>> +    else
>> +        args="$args $c"
>>      fi
>>  done
>>
>> @@ -176,18 +174,20 @@ if [ "$CMD" = "--debug" ]; then
>>    CMD="RUN"
>>    JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE
>> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
>>    echo "Please start the remote debugging client to continue..."
>> -elif [ "$CMD" = "--n" ]; then
>> -  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed
>> 's/[0-9]//g'` ]]; then
>> -    echo " Please specify the number of instances to start after the --n
>> option"
>> -    exit 1
>> -  fi
>>  elif [ "$CMD" = "start" ]; then
>> +  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>> +    if  ps -p $PID >&- ; then
>> +      echo "Process is already running"
>> +      exit 0
>> +    fi
>> +  fi
>>    export CARBON_HOME=$CARBON_HOME
>> -  nohup $CARBON_HOME/bin/stratos.sh &
>> +# using nohup bash to avoid erros in solaris OS.TODO
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "stop" ]; then
>>    export CARBON_HOME=$CARBON_HOME
>> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
>> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>>    exit 0
>>  elif [ "$CMD" = "restart" ]; then
>>    export CARBON_HOME=$CARBON_HOME
>> @@ -196,13 +196,13 @@ elif [ "$CMD" = "restart" ]; then
>>    pid=`cat $CARBON_HOME/wso2carbon.pid`
>>    while [ "$process_status" -eq "0" ]
>>    do
>> -    sleep 1;
>> -    ps -p$pid 2>&1 > /dev/null
>> -    process_status=$?
>> +        sleep 1;
>> +        ps -p$pid 2>&1 > /dev/null
>> +        process_status=$?
>>    done
>>
>> -  # using nohup bash to avoid erros in solaris OS.TODO
>> -  nohup bash $CARBON_HOME/bin/stratos.sh > /dev/null 2>&1 &
>> +# using nohup bash to avoid erros in solaris OS.TODO
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "test" ]; then
>>      JAVACMD="exec "$JAVACMD""
>> @@ -212,18 +212,11 @@ elif [ "$CMD" = "version" ]; then
>>    exit 0
>>  fi
>>
>> +# ---------- Handle the SSL Issue with proper JDK version
>> --------------------
>>  jdk_16=`$JAVA_HOME/bin/java -version 2>&1 | grep "1.[6|7]"`
>> -
>>  if [ "$jdk_16" = "" ]; then
>> +   echo " Starting WSO2 Carbon (in unsupported JDK)"
>>     echo " [ERROR] CARBON is supported only on JDK 1.6 and 1.7"
>> -   exit 1
>> -fi
>> -
>> -CARBON_CLASSPATH=""
>> -if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
>> -   if [ "$f" != "$JAVA_HOME/lib/tools.jar" ];then
>> -        CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar"
>> -   fi
>>  fi
>>
>>  CARBON_XBOOTCLASSPATH=""
>> @@ -236,13 +229,20 @@ done
>>
>>
>>  JAVA_ENDORSED_DIRS="$CARBON_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed"
>>
>> +CARBON_CLASSPATH=""
>> +if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
>> +    CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar"
>> +fi
>>  for f in "$CARBON_HOME"/bin/*.jar
>>  do
>>      if [ "$f" != "$CARBON_HOME/bin/*.jar" ];then
>>          CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
>>      fi
>>  done
>> -
>> +for t in "$CARBON_HOME"/lib/commons-lang*.jar
>> +do
>> +    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
>> +done
>>  # For Cygwin, switch paths to Windows format before running java
>>  if $cygwin; then
>>    JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
>> @@ -261,41 +261,44 @@ echo CARBON_HOME environment variable is set to
>> $CARBON_HOME
>>
>>  cd "$CARBON_HOME"
>>
>> -exec "$JAVACMD" \
>> -        -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>> -        -d64 \
>> -        -server \
>> -        -Xms1500m -Xmx3000m \
>> -        -XX:PermSize=256m -XX:MaxPermSize=512m \
>> -        -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit
>> \
>> -        -XX:+CMSClassUnloadingEnabled \
>> -        -XX:+OptimizeStringConcat \
>> -        -XX:+HeapDumpOnOutOfMemoryError \
>> -        -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
>> -        -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
>> -        -XX:ErrorFile=repository/logs/hs_err_pid.log \
>> -        -XX:OnError="nohup ./stratos.sh &" \
>> -        $JAVA_OPTS \
>> -        -Dcarbon.pid=$$ \
>> -        -Dcom.sun.management.jmxremote \
>> -        -Dwso2.loadbalancer=true \
>> -        -classpath "$CARBON_CLASSPATH" \
>> -        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
>> -        -Djava.io.tmpdir="$CARBON_HOME/tmp" \
>> -        -Dwso2.server.standalone=true \
>> -        -Dcarbon.registry.root=/ \
>> -        -Dcarbon.home="$CARBON_HOME" \
>> -
>>  -Dloadbalancer.conf.file="$CARBON_HOME/repository/conf/loadbalancer.conf" \
>> -
>>  -Djava.util.logging.config.file="$CARBON_HOME/lib/log4j.properties" \
>> -        -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
>> -        -Dconf.location="$CARBON_HOME/repository/conf" \
>> -        -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>> -        -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
>> -
>>  -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
>> -        -Dcom.atomikos.icatch.hide_init_file_path=true \
>> -        -Dorg.terracotta.quartz.skipUpdateCheck=true \
>> -
>>  -Djavax.net.ssl.trustStore=$CARBON_HOME/repository/resources/security/client-truststore.jks
>> \
>> -        -Djavax.net.ssl.trustStorePassword=wso2carbon \
>> -        org.wso2.carbon.bootstrap.Bootstrap $*
>> +START_EXIT_STATUS=121
>> +status=$START_EXIT_STATUS
>>
>> +#To monitor a Carbon server in remote JMX mode on linux host machines,
>> set the below system property.
>> +#   -Djava.rmi.server.hostname="your.IP.goes.here"
>>
>> +while [ "$status" = "$START_EXIT_STATUS" ]
>> +do
>> +    $JAVACMD \
>> +    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>> +    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
>> +    -server \
>> +    -XX:+HeapDumpOnOutOfMemoryError \
>> +    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
>> +    $JAVA_OPTS \
>> +    -Dcom.sun.management.jmxremote \
>> +    -classpath "$CARBON_CLASSPATH" \
>> +    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
>> +    -Djava.io.tmpdir="$CARBON_HOME/tmp" \
>> +    -Dcatalina.base="$CARBON_HOME/lib/tomcat" \
>> +    -Dwso2.server.standalone=true \
>> +    -Dcarbon.registry.root=/ \
>> +    -Djava.command="$JAVACMD" \
>> +    -Dcarbon.home="$CARBON_HOME" \
>> +    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>> +    -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
>> +
>>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
>> \
>> +    -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
>> +    -Dconf.location="$CARBON_HOME/repository/conf"\
>> +
>>  -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
>> +    -Dcom.atomikos.icatch.hide_init_file_path=true \
>> +    -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
>> +    -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
>> +    -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
>> +    -Dorg.terracotta.quartz.skipUpdateCheck=true \
>> +    -Djava.security.egd=file:/dev/./urandom \
>> +    -Dfile.encoding=UTF8 \
>> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>> +    org.wso2.carbon.bootstrap.Bootstrap $*
>> +    status=$?
>> +done
>>
>>
>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/stratos-manager/modules/distribution/src/bin/stratos.sh
>> ----------------------------------------------------------------------
>> diff --git
>> a/products/stratos-manager/modules/distribution/src/bin/stratos.sh
>> b/products/stratos-manager/modules/distribution/src/bin/stratos.sh
>> index 7cb00b5..77f7a91 100755
>> --- a/products/stratos-manager/modules/distribution/src/bin/stratos.sh
>> +++ b/products/stratos-manager/modules/distribution/src/bin/stratos.sh
>> @@ -1,23 +1,25 @@
>>  #!/bin/sh
>>  #
>> ----------------------------------------------------------------------------
>> -#  Copyright 2005-2012 WSO2, Inc. http://www.wso2.org
>> -#
>> -#  Licensed 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
>> +#  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.
>> -
>> +#  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.
>>  #
>> ----------------------------------------------------------------------------
>> -# Main Script for the WSO2 Carbon Server
>> +# Main Script for the Apache Stratos (incubating)
>>  #
>> -# Environment Variable Prequisites
>> +# Environment Variable Prerequisites
>>  #
>>  #   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will
>>  try
>>  #                   to figure it out.
>> @@ -136,6 +138,7 @@ if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>>  fi
>>
>>  # ----- Process the input command
>> ----------------------------------------------
>> +args=""
>>  for c in $*
>>  do
>>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug"
>> ]; then
>> @@ -155,6 +158,8 @@ do
>>            CMD="restart"
>>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
>> then
>>            CMD="test"
>> +    else
>> +        args="$args $c"
>>      fi
>>  done
>>
>> @@ -178,7 +183,7 @@ elif [ "$CMD" = "start" ]; then
>>    fi
>>    export CARBON_HOME=$CARBON_HOME
>>  # using nohup bash to avoid erros in solaris OS.TODO
>> -  nohup bash $CARBON_HOME/bin/stratos.sh > /dev/null 2>&1 &
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "stop" ]; then
>>    export CARBON_HOME=$CARBON_HOME
>> @@ -197,7 +202,7 @@ elif [ "$CMD" = "restart" ]; then
>>    done
>>
>>  # using nohup bash to avoid erros in solaris OS.TODO
>> -  nohup bash $CARBON_HOME/bin/stratos.sh > /dev/null 2>&1 &
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "test" ]; then
>>      JAVACMD="exec "$JAVACMD""
>> @@ -267,6 +272,7 @@ do
>>      $JAVACMD \
>>      -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>>      -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
>> +    -server \
>>      -XX:+HeapDumpOnOutOfMemoryError \
>>      -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
>>      $JAVA_OPTS \
>> @@ -279,12 +285,11 @@ do
>>      -Dcarbon.registry.root=/ \
>>      -Djava.command="$JAVACMD" \
>>      -Dcarbon.home="$CARBON_HOME" \
>> -
>>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties"
>> \
>>      -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>>      -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
>> +
>>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
>> \
>>      -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
>>      -Dconf.location="$CARBON_HOME/repository/conf"\
>> -    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>>
>>  -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
>>      -Dcom.atomikos.icatch.hide_init_file_path=true \
>>      -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
>> @@ -293,7 +298,7 @@ do
>>      -Dorg.terracotta.quartz.skipUpdateCheck=true \
>>      -Djava.security.egd=file:/dev/./urandom \
>>      -Dfile.encoding=UTF8 \
>> -    -Dloadbalancer.conf=file:repository/conf/loadbalancer.conf \
>> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>>      org.wso2.carbon.bootstrap.Bootstrap $*
>>      status=$?
>>  done
>>
>>
>> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/tools/stratos-installer/config/cc/bin/stratos.sh
>> ----------------------------------------------------------------------
>> diff --git a/tools/stratos-installer/config/cc/bin/stratos.sh
>> b/tools/stratos-installer/config/cc/bin/stratos.sh
>> index c9a5812..77f7a91 100644
>> --- a/tools/stratos-installer/config/cc/bin/stratos.sh
>> +++ b/tools/stratos-installer/config/cc/bin/stratos.sh
>> @@ -1,27 +1,29 @@
>>  #!/bin/sh
>>  #
>> ----------------------------------------------------------------------------
>> -# 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
>> +#  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
>> +#      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.
>> -
>> +#  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.
>>  #
>> ----------------------------------------------------------------------------
>> -# Main Script for the Apache Stratos
>> +# Main Script for the Apache Stratos (incubating)
>>  #
>>  # Environment Variable Prerequisites
>>  #
>> +#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will
>>  try
>> +#                   to figure it out.
>> +#
>>  #   JAVA_HOME       Must point at your Java Development Kit installation.
>>  #
>>  #   JAVA_OPTS       (Optional) Java runtime options used when the
>> commands
>> @@ -31,6 +33,7 @@
>>  #
>> -----------------------------------------------------------------------------
>>
>>  # OS specific support.  $var _must_ be set to either true or false.
>> +#ulimit -n 100000
>>
>>  cygwin=false;
>>  darwin=false;
>> @@ -130,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
>>    exit 1
>>  fi
>>
>> +if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>> +  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
>> +fi
>> +
>>  # ----- Process the input command
>> ----------------------------------------------
>> +args=""
>>  for c in $*
>>  do
>>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug"
>> ]; then
>> @@ -140,29 +148,18 @@ do
>>            if [ -z "$PORT" ]; then
>>                  PORT=$c
>>            fi
>> -    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
>> -          CMD="--n"
>> -          continue
>> -    elif [ "$CMD" = "--n" ]; then
>> -          if [ -z "$INSTANCES" ]; then
>> -                INSTANCES=$c
>> -          fi
>>      elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ];
>> then
>>            CMD="stop"
>>      elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start"
>> ]; then
>>            CMD="start"
>> -    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" =
>> "console" ]; then
>> -          CMD="console"
>>      elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" =
>> "version" ]; then
>>            CMD="version"
>>      elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" =
>> "restart" ]; then
>>            CMD="restart"
>> -    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ];
>> then
>> -          CMD="dump"
>>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
>> then
>>            CMD="test"
>> -    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" =
>> "status" ]; then
>> -          CMD="status"
>> +    else
>> +        args="$args $c"
>>      fi
>>  done
>>
>> @@ -177,23 +174,35 @@ if [ "$CMD" = "--debug" ]; then
>>    CMD="RUN"
>>    JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE
>> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
>>    echo "Please start the remote debugging client to continue..."
>> -elif [ "$CMD" = "--n" ]; then
>> -  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed
>> 's/[0-9]//g'` ]]; then
>> -    echo " Please specify the number of instances to start after the --n
>> option"
>> -    exit 1
>> -  fi
>>  elif [ "$CMD" = "start" ]; then
>> +  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>> +    if  ps -p $PID >&- ; then
>> +      echo "Process is already running"
>> +      exit 0
>> +    fi
>> +  fi
>>    export CARBON_HOME=$CARBON_HOME
>> -  nohup $CARBON_HOME/bin/stratos.sh &
>> +# using nohup bash to avoid erros in solaris OS.TODO
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "stop" ]; then
>>    export CARBON_HOME=$CARBON_HOME
>> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
>> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>>    exit 0
>>  elif [ "$CMD" = "restart" ]; then
>>    export CARBON_HOME=$CARBON_HOME
>> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
>> -  nohup $CARBON_HOME/bin/stratos.sh &
>> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>> +  process_status=0
>> +  pid=`cat $CARBON_HOME/wso2carbon.pid`
>> +  while [ "$process_status" -eq "0" ]
>> +  do
>> +        sleep 1;
>> +        ps -p$pid 2>&1 > /dev/null
>> +        process_status=$?
>> +  done
>> +
>> +# using nohup bash to avoid erros in solaris OS.TODO
>> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>>    exit 0
>>  elif [ "$CMD" = "test" ]; then
>>      JAVACMD="exec "$JAVACMD""
>> @@ -230,7 +239,10 @@ do
>>          CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
>>      fi
>>  done
>> -
>> +for t in "$CARBON_HOME"/lib/commons-lang*.jar
>> +do
>> +    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
>> +done
>>  # For Cygwin, switch paths to Windows format before running java
>>  if $cygwin; then
>>    JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
>> @@ -252,25 +264,18 @@ cd "$CARBON_HOME"
>>  START_EXIT_STATUS=121
>>  status=$START_EXIT_STATUS
>>
>> +#To monitor a Carbon server in remote JMX mode on linux host machines,
>> set the below system property.
>> +#   -Djava.rmi.server.hostname="your.IP.goes.here"
>> +
>>  while [ "$status" = "$START_EXIT_STATUS" ]
>>  do
>>      $JAVACMD \
>> -     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>> -     -d64 \
>> -     -server \
>> -     -Xms1500m -Xmx3000m \
>> -     -XX:PermSize=256m -XX:MaxPermSize=512m \
>> -     -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
>> -     -XX:+CMSClassUnloadingEnabled \
>> -     -XX:+OptimizeStringConcat \
>> -     -XX:+HeapDumpOnOutOfMemoryError \
>> -     -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
>> -     -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
>> -     -XX:ErrorFile=repository/logs/hs_err_pid.log \
>> -     -XX:OnError="nohup ./stratos.sh &" \
>> +    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>> +    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
>> +    -server \
>> +    -XX:+HeapDumpOnOutOfMemoryError \
>> +    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
>>      $JAVA_OPTS \
>> -    -DandesConfig=qpid-config.xml \
>> -    -Ddisable.cassandra.server.startup=true \
>>      -Dcom.sun.management.jmxremote \
>>      -classpath "$CARBON_CLASSPATH" \
>>      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
>> @@ -280,16 +285,20 @@ do
>>      -Dcarbon.registry.root=/ \
>>      -Djava.command="$JAVACMD" \
>>      -Dcarbon.home="$CARBON_HOME" \
>> -
>>  -Dwso2.transports.xml="$CARBON_HOME/repository/conf/mgt-transports.xml" \
>> -
>>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties"
>> \
>> +    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>>      -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
>> +
>>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
>> \
>>      -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
>> +    -Dconf.location="$CARBON_HOME/repository/conf"\
>>
>>  -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
>>      -Dcom.atomikos.icatch.hide_init_file_path=true \
>>      -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
>>      -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
>>      -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
>>      -Dorg.terracotta.quartz.skipUpdateCheck=true \
>> +    -Djava.security.egd=file:/dev/./urandom \
>> +    -Dfile.encoding=UTF8 \
>> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>>      org.wso2.carbon.bootstrap.Bootstrap $*
>>      status=$?
>>  done
>>
>>
>
>
> --
> --
> Lahiru Sandaruwan
> Software Engineer,
> Platform Technologies,
> WSO2 Inc., http://wso2.com
> lean.enterprise.middleware
>
> email: lahirus@wso2.com cell: (+94) 773 325 954
> blog: http://lahiruwrites.blogspot.com/
> twitter: http://twitter.com/lahirus
> linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146
>
>


-- 
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha

Re: [1/4] git commit: Updated stratos.sh (source: wso2server.sh from WSO2 Carbon 4.2.0)

Posted by Lahiru Sandaruwan <la...@wso2.com>.
Hi Isuru,

Seems following line is removed from loadbalancer startup script. This
cause errors while starting...


-Dloadbalancer.conf.file="$CARBON_HOME/repository/conf/loadbalancer.conf" \


On Mon, Jan 13, 2014 at 9:28 AM, <is...@apache.org> wrote:

> Updated Branches:
>   refs/heads/master f8605c956 -> 8adffee23
>
>
> Updated stratos.sh (source: wso2server.sh from WSO2 Carbon 4.2.0)
>
>
> Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
> Commit:
> http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/6cb59f64
> Tree:
> http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/6cb59f64
> Diff:
> http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/6cb59f64
>
> Branch: refs/heads/master
> Commit: 6cb59f64b8103b7efc91e8c0cb58b347f9b9991a
> Parents: b3420b3
> Author: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
> Authored: Thu Jan 9 15:08:32 2014 +0530
> Committer: M. Isuru Tharanga Chrishantha Perera <is...@apache.org>
> Committed: Thu Jan 9 15:09:34 2014 +0530
>
> ----------------------------------------------------------------------
>  .../distribution/src/main/resources/stratos.sh  | 122 ++++++++-------
>  .../distribution/src/main/resources/stratos.sh  | 123 ++++++++-------
>  .../distribution/src/main/bin/stratos.sh        | 151 ++++++++++---------
>  .../modules/distribution/src/bin/stratos.sh     |  41 ++---
>  .../stratos-installer/config/cc/bin/stratos.sh  | 121 ++++++++-------
>  5 files changed, 295 insertions(+), 263 deletions(-)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
> ----------------------------------------------------------------------
> diff --git
> a/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
> b/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
> index 0232137..77f7a91 100644
> ---
> a/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
> +++
> b/products/autoscaler/modules/distribution/src/main/resources/stratos.sh
> @@ -1,27 +1,29 @@
>  #!/bin/sh
>  #
> ----------------------------------------------------------------------------
> -# 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
> +#  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
> +#      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.
> -
> +#  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.
>  #
> ----------------------------------------------------------------------------
> -# Main Script for the Apache Stratos
> +# Main Script for the Apache Stratos (incubating)
>  #
>  # Environment Variable Prerequisites
>  #
> +#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
> +#                   to figure it out.
> +#
>  #   JAVA_HOME       Must point at your Java Development Kit installation.
>  #
>  #   JAVA_OPTS       (Optional) Java runtime options used when the commands
> @@ -31,6 +33,7 @@
>  #
> -----------------------------------------------------------------------------
>
>  # OS specific support.  $var _must_ be set to either true or false.
> +#ulimit -n 100000
>
>  cygwin=false;
>  darwin=false;
> @@ -130,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
>    exit 1
>  fi
>
> +if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
> +  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
> +fi
> +
>  # ----- Process the input command
> ----------------------------------------------
> +args=""
>  for c in $*
>  do
>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ];
> then
> @@ -140,29 +148,18 @@ do
>            if [ -z "$PORT" ]; then
>                  PORT=$c
>            fi
> -    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
> -          CMD="--n"
> -          continue
> -    elif [ "$CMD" = "--n" ]; then
> -          if [ -z "$INSTANCES" ]; then
> -                INSTANCES=$c
> -          fi
>      elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ];
> then
>            CMD="stop"
>      elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start"
> ]; then
>            CMD="start"
> -    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" =
> "console" ]; then
> -          CMD="console"
>      elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" =
> "version" ]; then
>            CMD="version"
>      elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" =
> "restart" ]; then
>            CMD="restart"
> -    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ];
> then
> -          CMD="dump"
>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
> then
>            CMD="test"
> -    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" =
> "status" ]; then
> -          CMD="status"
> +    else
> +        args="$args $c"
>      fi
>  done
>
> @@ -177,23 +174,35 @@ if [ "$CMD" = "--debug" ]; then
>    CMD="RUN"
>    JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE
> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
>    echo "Please start the remote debugging client to continue..."
> -elif [ "$CMD" = "--n" ]; then
> -  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed 's/[0-9]//g'`
> ]]; then
> -    echo " Please specify the number of instances to start after the --n
> option"
> -    exit 1
> -  fi
>  elif [ "$CMD" = "start" ]; then
> +  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
> +    if  ps -p $PID >&- ; then
> +      echo "Process is already running"
> +      exit 0
> +    fi
> +  fi
>    export CARBON_HOME=$CARBON_HOME
> -  nohup $CARBON_HOME/bin/stratos.sh &
> +# using nohup bash to avoid erros in solaris OS.TODO
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "stop" ]; then
>    export CARBON_HOME=$CARBON_HOME
> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>    exit 0
>  elif [ "$CMD" = "restart" ]; then
>    export CARBON_HOME=$CARBON_HOME
> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
> -  nohup $CARBON_HOME/bin/stratos.sh &
> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
> +  process_status=0
> +  pid=`cat $CARBON_HOME/wso2carbon.pid`
> +  while [ "$process_status" -eq "0" ]
> +  do
> +        sleep 1;
> +        ps -p$pid 2>&1 > /dev/null
> +        process_status=$?
> +  done
> +
> +# using nohup bash to avoid erros in solaris OS.TODO
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "test" ]; then
>      JAVACMD="exec "$JAVACMD""
> @@ -230,7 +239,10 @@ do
>          CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
>      fi
>  done
> -
> +for t in "$CARBON_HOME"/lib/commons-lang*.jar
> +do
> +    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
> +done
>  # For Cygwin, switch paths to Windows format before running java
>  if $cygwin; then
>    JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
> @@ -252,25 +264,18 @@ cd "$CARBON_HOME"
>  START_EXIT_STATUS=121
>  status=$START_EXIT_STATUS
>
> +#To monitor a Carbon server in remote JMX mode on linux host machines,
> set the below system property.
> +#   -Djava.rmi.server.hostname="your.IP.goes.here"
> +
>  while [ "$status" = "$START_EXIT_STATUS" ]
>  do
>      $JAVACMD \
> -     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
> -     -d64 \
> -     -server \
> -     -Xms1500m -Xmx3000m \
> -     -XX:PermSize=256m -XX:MaxPermSize=512m \
> -     -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
> -     -XX:+CMSClassUnloadingEnabled \
> -     -XX:+OptimizeStringConcat \
> -     -XX:+HeapDumpOnOutOfMemoryError \
> -     -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
> -     -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
> -     -XX:ErrorFile=repository/logs/hs_err_pid.log \
> -     -XX:OnError="nohup ./stratos.sh &" \
> +    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
> +    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
> +    -server \
> +    -XX:+HeapDumpOnOutOfMemoryError \
> +    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
>      $JAVA_OPTS \
> -    -DandesConfig=qpid-config.xml \
> -    -Ddisable.cassandra.server.startup=true \
>      -Dcom.sun.management.jmxremote \
>      -classpath "$CARBON_CLASSPATH" \
>      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
> @@ -280,17 +285,20 @@ do
>      -Dcarbon.registry.root=/ \
>      -Djava.command="$JAVACMD" \
>      -Dcarbon.home="$CARBON_HOME" \
> -
>  -Dwso2.transports.xml="$CARBON_HOME/repository/conf/mgt-transports.xml" \
> -
>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties"
> \
> +    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>      -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
> -    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
> +
>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
> \
>      -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
> +    -Dconf.location="$CARBON_HOME/repository/conf"\
>      -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties"
> \
>      -Dcom.atomikos.icatch.hide_init_file_path=true \
>      -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
>      -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
>      -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
>      -Dorg.terracotta.quartz.skipUpdateCheck=true \
> +    -Djava.security.egd=file:/dev/./urandom \
> +    -Dfile.encoding=UTF8 \
> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>      org.wso2.carbon.bootstrap.Bootstrap $*
>      status=$?
>  done
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
> ----------------------------------------------------------------------
> diff --git
> a/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
> b/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
> index 2a5176e..77f7a91 100644
> ---
> a/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
> +++
> b/products/cloud-controller/modules/distribution/src/main/resources/stratos.sh
> @@ -1,27 +1,29 @@
>  #!/bin/sh
>  #
> ----------------------------------------------------------------------------
> -# 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
> +#  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
> +#      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.
> -
> +#  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.
>  #
> ----------------------------------------------------------------------------
> -# Main Script for the Apache Stratos
> +# Main Script for the Apache Stratos (incubating)
>  #
>  # Environment Variable Prerequisites
>  #
> +#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
> +#                   to figure it out.
> +#
>  #   JAVA_HOME       Must point at your Java Development Kit installation.
>  #
>  #   JAVA_OPTS       (Optional) Java runtime options used when the commands
> @@ -31,6 +33,7 @@
>  #
> -----------------------------------------------------------------------------
>
>  # OS specific support.  $var _must_ be set to either true or false.
> +#ulimit -n 100000
>
>  cygwin=false;
>  darwin=false;
> @@ -130,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
>    exit 1
>  fi
>
> +if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
> +  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
> +fi
> +
>  # ----- Process the input command
> ----------------------------------------------
> +args=""
>  for c in $*
>  do
>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ];
> then
> @@ -140,29 +148,18 @@ do
>            if [ -z "$PORT" ]; then
>                  PORT=$c
>            fi
> -    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
> -          CMD="--n"
> -          continue
> -    elif [ "$CMD" = "--n" ]; then
> -          if [ -z "$INSTANCES" ]; then
> -                INSTANCES=$c
> -          fi
>      elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ];
> then
>            CMD="stop"
>      elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start"
> ]; then
>            CMD="start"
> -    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" =
> "console" ]; then
> -          CMD="console"
>      elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" =
> "version" ]; then
>            CMD="version"
>      elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" =
> "restart" ]; then
>            CMD="restart"
> -    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ];
> then
> -          CMD="dump"
>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
> then
>            CMD="test"
> -    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" =
> "status" ]; then
> -          CMD="status"
> +    else
> +        args="$args $c"
>      fi
>  done
>
> @@ -177,23 +174,35 @@ if [ "$CMD" = "--debug" ]; then
>    CMD="RUN"
>    JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE
> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
>    echo "Please start the remote debugging client to continue..."
> -elif [ "$CMD" = "--n" ]; then
> -  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed 's/[0-9]//g'`
> ]]; then
> -    echo " Please specify the number of instances to start after the --n
> option"
> -    exit 1
> -  fi
>  elif [ "$CMD" = "start" ]; then
> +  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
> +    if  ps -p $PID >&- ; then
> +      echo "Process is already running"
> +      exit 0
> +    fi
> +  fi
>    export CARBON_HOME=$CARBON_HOME
> -  nohup $CARBON_HOME/bin/stratos.sh &
> +# using nohup bash to avoid erros in solaris OS.TODO
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "stop" ]; then
>    export CARBON_HOME=$CARBON_HOME
> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>    exit 0
>  elif [ "$CMD" = "restart" ]; then
>    export CARBON_HOME=$CARBON_HOME
> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
> -  nohup $CARBON_HOME/bin/stratos.sh &
> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
> +  process_status=0
> +  pid=`cat $CARBON_HOME/wso2carbon.pid`
> +  while [ "$process_status" -eq "0" ]
> +  do
> +        sleep 1;
> +        ps -p$pid 2>&1 > /dev/null
> +        process_status=$?
> +  done
> +
> +# using nohup bash to avoid erros in solaris OS.TODO
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "test" ]; then
>      JAVACMD="exec "$JAVACMD""
> @@ -230,7 +239,10 @@ do
>          CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
>      fi
>  done
> -
> +for t in "$CARBON_HOME"/lib/commons-lang*.jar
> +do
> +    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
> +done
>  # For Cygwin, switch paths to Windows format before running java
>  if $cygwin; then
>    JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
> @@ -252,25 +264,18 @@ cd "$CARBON_HOME"
>  START_EXIT_STATUS=121
>  status=$START_EXIT_STATUS
>
> +#To monitor a Carbon server in remote JMX mode on linux host machines,
> set the below system property.
> +#   -Djava.rmi.server.hostname="your.IP.goes.here"
> +
>  while [ "$status" = "$START_EXIT_STATUS" ]
>  do
>      $JAVACMD \
> -     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
> -     -d64 \
> -     -server \
> -     -Xms1500m -Xmx3000m \
> -     -XX:PermSize=256m -XX:MaxPermSize=512m \
> -     -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
> -     -XX:+CMSClassUnloadingEnabled \
> -     -XX:+OptimizeStringConcat \
> -     -XX:+HeapDumpOnOutOfMemoryError \
> -     -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
> -     -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
> -     -XX:ErrorFile=repository/logs/hs_err_pid.log \
> -     -XX:OnError="nohup ./stratos.sh &" \
> +    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
> +    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
> +    -server \
> +    -XX:+HeapDumpOnOutOfMemoryError \
> +    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
>      $JAVA_OPTS \
> -    -DandesConfig=qpid-config.xml \
> -    -Ddisable.cassandra.server.startup=true \
>      -Dcom.sun.management.jmxremote \
>      -classpath "$CARBON_CLASSPATH" \
>      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
> @@ -280,18 +285,20 @@ do
>      -Dcarbon.registry.root=/ \
>      -Djava.command="$JAVACMD" \
>      -Dcarbon.home="$CARBON_HOME" \
> -
>  -Dwso2.transports.xml="$CARBON_HOME/repository/conf/mgt-transports.xml" \
> -
>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties"
> \
> +    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>      -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
> -    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
> +
>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
> \
>      -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
> +    -Dconf.location="$CARBON_HOME/repository/conf"\
>      -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties"
> \
>      -Dcom.atomikos.icatch.hide_init_file_path=true \
>      -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
> -    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>      -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
>      -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
>      -Dorg.terracotta.quartz.skipUpdateCheck=true \
> +    -Djava.security.egd=file:/dev/./urandom \
> +    -Dfile.encoding=UTF8 \
> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>      org.wso2.carbon.bootstrap.Bootstrap $*
>      status=$?
>  done
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
> ----------------------------------------------------------------------
> diff --git
> a/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
> b/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
> index 7d8f2f1..77f7a91 100644
> --- a/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
> +++ b/products/load-balancer/modules/distribution/src/main/bin/stratos.sh
> @@ -17,19 +17,23 @@
>  #  specific language governing permissions and limitations
>  #  under the License.
>  #
> ----------------------------------------------------------------------------
> -#  Main Script for the Apache Stratos
> +# Main Script for the Apache Stratos (incubating)
>  #
> -#  Environment Variable Prerequisites
> +# Environment Variable Prerequisites
> +#
> +#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
> +#                   to figure it out.
>  #
>  #   JAVA_HOME       Must point at your Java Development Kit installation.
>  #
>  #   JAVA_OPTS       (Optional) Java runtime options used when the commands
>  #                   is executed.
>  #
> -#  NOTE: Borrowed generously from Apache Tomcat startup scripts.
> +# NOTE: Borrowed generously from Apache Tomcat startup scripts.
>  #
> -----------------------------------------------------------------------------
>
>  # OS specific support.  $var _must_ be set to either true or false.
> +#ulimit -n 100000
>
>  cygwin=false;
>  darwin=false;
> @@ -129,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
>    exit 1
>  fi
>
> +if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
> +  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
> +fi
> +
>  # ----- Process the input command
> ----------------------------------------------
> +args=""
>  for c in $*
>  do
>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ];
> then
> @@ -139,29 +148,18 @@ do
>            if [ -z "$PORT" ]; then
>                  PORT=$c
>            fi
> -    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
> -          CMD="--n"
> -          continue
> -    elif [ "$CMD" = "--n" ]; then
> -          if [ -z "$INSTANCES" ]; then
> -                INSTANCES=$c
> -          fi
>      elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ];
> then
>            CMD="stop"
>      elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start"
> ]; then
>            CMD="start"
> -    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" =
> "console" ]; then
> -          CMD="console"
>      elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" =
> "version" ]; then
>            CMD="version"
>      elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" =
> "restart" ]; then
>            CMD="restart"
> -    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ];
> then
> -          CMD="dump"
>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
> then
>            CMD="test"
> -    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" =
> "status" ]; then
> -          CMD="status"
> +    else
> +        args="$args $c"
>      fi
>  done
>
> @@ -176,18 +174,20 @@ if [ "$CMD" = "--debug" ]; then
>    CMD="RUN"
>    JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE
> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
>    echo "Please start the remote debugging client to continue..."
> -elif [ "$CMD" = "--n" ]; then
> -  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed 's/[0-9]//g'`
> ]]; then
> -    echo " Please specify the number of instances to start after the --n
> option"
> -    exit 1
> -  fi
>  elif [ "$CMD" = "start" ]; then
> +  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
> +    if  ps -p $PID >&- ; then
> +      echo "Process is already running"
> +      exit 0
> +    fi
> +  fi
>    export CARBON_HOME=$CARBON_HOME
> -  nohup $CARBON_HOME/bin/stratos.sh &
> +# using nohup bash to avoid erros in solaris OS.TODO
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "stop" ]; then
>    export CARBON_HOME=$CARBON_HOME
> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>    exit 0
>  elif [ "$CMD" = "restart" ]; then
>    export CARBON_HOME=$CARBON_HOME
> @@ -196,13 +196,13 @@ elif [ "$CMD" = "restart" ]; then
>    pid=`cat $CARBON_HOME/wso2carbon.pid`
>    while [ "$process_status" -eq "0" ]
>    do
> -    sleep 1;
> -    ps -p$pid 2>&1 > /dev/null
> -    process_status=$?
> +        sleep 1;
> +        ps -p$pid 2>&1 > /dev/null
> +        process_status=$?
>    done
>
> -  # using nohup bash to avoid erros in solaris OS.TODO
> -  nohup bash $CARBON_HOME/bin/stratos.sh > /dev/null 2>&1 &
> +# using nohup bash to avoid erros in solaris OS.TODO
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "test" ]; then
>      JAVACMD="exec "$JAVACMD""
> @@ -212,18 +212,11 @@ elif [ "$CMD" = "version" ]; then
>    exit 0
>  fi
>
> +# ---------- Handle the SSL Issue with proper JDK version
> --------------------
>  jdk_16=`$JAVA_HOME/bin/java -version 2>&1 | grep "1.[6|7]"`
> -
>  if [ "$jdk_16" = "" ]; then
> +   echo " Starting WSO2 Carbon (in unsupported JDK)"
>     echo " [ERROR] CARBON is supported only on JDK 1.6 and 1.7"
> -   exit 1
> -fi
> -
> -CARBON_CLASSPATH=""
> -if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
> -   if [ "$f" != "$JAVA_HOME/lib/tools.jar" ];then
> -        CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar"
> -   fi
>  fi
>
>  CARBON_XBOOTCLASSPATH=""
> @@ -236,13 +229,20 @@ done
>
>
>  JAVA_ENDORSED_DIRS="$CARBON_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed"
>
> +CARBON_CLASSPATH=""
> +if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
> +    CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar"
> +fi
>  for f in "$CARBON_HOME"/bin/*.jar
>  do
>      if [ "$f" != "$CARBON_HOME/bin/*.jar" ];then
>          CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
>      fi
>  done
> -
> +for t in "$CARBON_HOME"/lib/commons-lang*.jar
> +do
> +    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
> +done
>  # For Cygwin, switch paths to Windows format before running java
>  if $cygwin; then
>    JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
> @@ -261,41 +261,44 @@ echo CARBON_HOME environment variable is set to
> $CARBON_HOME
>
>  cd "$CARBON_HOME"
>
> -exec "$JAVACMD" \
> -        -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
> -        -d64 \
> -        -server \
> -        -Xms1500m -Xmx3000m \
> -        -XX:PermSize=256m -XX:MaxPermSize=512m \
> -        -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
> -        -XX:+CMSClassUnloadingEnabled \
> -        -XX:+OptimizeStringConcat \
> -        -XX:+HeapDumpOnOutOfMemoryError \
> -        -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
> -        -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
> -        -XX:ErrorFile=repository/logs/hs_err_pid.log \
> -        -XX:OnError="nohup ./stratos.sh &" \
> -        $JAVA_OPTS \
> -        -Dcarbon.pid=$$ \
> -        -Dcom.sun.management.jmxremote \
> -        -Dwso2.loadbalancer=true \
> -        -classpath "$CARBON_CLASSPATH" \
> -        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
> -        -Djava.io.tmpdir="$CARBON_HOME/tmp" \
> -        -Dwso2.server.standalone=true \
> -        -Dcarbon.registry.root=/ \
> -        -Dcarbon.home="$CARBON_HOME" \
> -
>  -Dloadbalancer.conf.file="$CARBON_HOME/repository/conf/loadbalancer.conf" \
> -
>  -Djava.util.logging.config.file="$CARBON_HOME/lib/log4j.properties" \
> -        -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
> -        -Dconf.location="$CARBON_HOME/repository/conf" \
> -        -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
> -        -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
> -
>  -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
> -        -Dcom.atomikos.icatch.hide_init_file_path=true \
> -        -Dorg.terracotta.quartz.skipUpdateCheck=true \
> -
>  -Djavax.net.ssl.trustStore=$CARBON_HOME/repository/resources/security/client-truststore.jks
> \
> -        -Djavax.net.ssl.trustStorePassword=wso2carbon \
> -        org.wso2.carbon.bootstrap.Bootstrap $*
> +START_EXIT_STATUS=121
> +status=$START_EXIT_STATUS
>
> +#To monitor a Carbon server in remote JMX mode on linux host machines,
> set the below system property.
> +#   -Djava.rmi.server.hostname="your.IP.goes.here"
>
> +while [ "$status" = "$START_EXIT_STATUS" ]
> +do
> +    $JAVACMD \
> +    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
> +    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
> +    -server \
> +    -XX:+HeapDumpOnOutOfMemoryError \
> +    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
> +    $JAVA_OPTS \
> +    -Dcom.sun.management.jmxremote \
> +    -classpath "$CARBON_CLASSPATH" \
> +    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
> +    -Djava.io.tmpdir="$CARBON_HOME/tmp" \
> +    -Dcatalina.base="$CARBON_HOME/lib/tomcat" \
> +    -Dwso2.server.standalone=true \
> +    -Dcarbon.registry.root=/ \
> +    -Djava.command="$JAVACMD" \
> +    -Dcarbon.home="$CARBON_HOME" \
> +    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
> +    -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
> +
>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
> \
> +    -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
> +    -Dconf.location="$CARBON_HOME/repository/conf"\
> +    -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties"
> \
> +    -Dcom.atomikos.icatch.hide_init_file_path=true \
> +    -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
> +    -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
> +    -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
> +    -Dorg.terracotta.quartz.skipUpdateCheck=true \
> +    -Djava.security.egd=file:/dev/./urandom \
> +    -Dfile.encoding=UTF8 \
> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
> +    org.wso2.carbon.bootstrap.Bootstrap $*
> +    status=$?
> +done
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/products/stratos-manager/modules/distribution/src/bin/stratos.sh
> ----------------------------------------------------------------------
> diff --git
> a/products/stratos-manager/modules/distribution/src/bin/stratos.sh
> b/products/stratos-manager/modules/distribution/src/bin/stratos.sh
> index 7cb00b5..77f7a91 100755
> --- a/products/stratos-manager/modules/distribution/src/bin/stratos.sh
> +++ b/products/stratos-manager/modules/distribution/src/bin/stratos.sh
> @@ -1,23 +1,25 @@
>  #!/bin/sh
>  #
> ----------------------------------------------------------------------------
> -#  Copyright 2005-2012 WSO2, Inc. http://www.wso2.org
> -#
> -#  Licensed 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
> +#  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.
> -
> +#  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.
>  #
> ----------------------------------------------------------------------------
> -# Main Script for the WSO2 Carbon Server
> +# Main Script for the Apache Stratos (incubating)
>  #
> -# Environment Variable Prequisites
> +# Environment Variable Prerequisites
>  #
>  #   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
>  #                   to figure it out.
> @@ -136,6 +138,7 @@ if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
>  fi
>
>  # ----- Process the input command
> ----------------------------------------------
> +args=""
>  for c in $*
>  do
>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ];
> then
> @@ -155,6 +158,8 @@ do
>            CMD="restart"
>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
> then
>            CMD="test"
> +    else
> +        args="$args $c"
>      fi
>  done
>
> @@ -178,7 +183,7 @@ elif [ "$CMD" = "start" ]; then
>    fi
>    export CARBON_HOME=$CARBON_HOME
>  # using nohup bash to avoid erros in solaris OS.TODO
> -  nohup bash $CARBON_HOME/bin/stratos.sh > /dev/null 2>&1 &
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "stop" ]; then
>    export CARBON_HOME=$CARBON_HOME
> @@ -197,7 +202,7 @@ elif [ "$CMD" = "restart" ]; then
>    done
>
>  # using nohup bash to avoid erros in solaris OS.TODO
> -  nohup bash $CARBON_HOME/bin/stratos.sh > /dev/null 2>&1 &
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "test" ]; then
>      JAVACMD="exec "$JAVACMD""
> @@ -267,6 +272,7 @@ do
>      $JAVACMD \
>      -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
>      -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
> +    -server \
>      -XX:+HeapDumpOnOutOfMemoryError \
>      -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
>      $JAVA_OPTS \
> @@ -279,12 +285,11 @@ do
>      -Dcarbon.registry.root=/ \
>      -Djava.command="$JAVACMD" \
>      -Dcarbon.home="$CARBON_HOME" \
> -
>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties"
> \
>      -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>      -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
> +
>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
> \
>      -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
>      -Dconf.location="$CARBON_HOME/repository/conf"\
> -    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>      -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties"
> \
>      -Dcom.atomikos.icatch.hide_init_file_path=true \
>      -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
> @@ -293,7 +298,7 @@ do
>      -Dorg.terracotta.quartz.skipUpdateCheck=true \
>      -Djava.security.egd=file:/dev/./urandom \
>      -Dfile.encoding=UTF8 \
> -    -Dloadbalancer.conf=file:repository/conf/loadbalancer.conf \
> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>      org.wso2.carbon.bootstrap.Bootstrap $*
>      status=$?
>  done
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6cb59f64/tools/stratos-installer/config/cc/bin/stratos.sh
> ----------------------------------------------------------------------
> diff --git a/tools/stratos-installer/config/cc/bin/stratos.sh
> b/tools/stratos-installer/config/cc/bin/stratos.sh
> index c9a5812..77f7a91 100644
> --- a/tools/stratos-installer/config/cc/bin/stratos.sh
> +++ b/tools/stratos-installer/config/cc/bin/stratos.sh
> @@ -1,27 +1,29 @@
>  #!/bin/sh
>  #
> ----------------------------------------------------------------------------
> -# 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
> +#  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
> +#      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.
> -
> +#  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.
>  #
> ----------------------------------------------------------------------------
> -# Main Script for the Apache Stratos
> +# Main Script for the Apache Stratos (incubating)
>  #
>  # Environment Variable Prerequisites
>  #
> +#   CARBON_HOME   Home of WSO2 Carbon installation. If not set I will  try
> +#                   to figure it out.
> +#
>  #   JAVA_HOME       Must point at your Java Development Kit installation.
>  #
>  #   JAVA_OPTS       (Optional) Java runtime options used when the commands
> @@ -31,6 +33,7 @@
>  #
> -----------------------------------------------------------------------------
>
>  # OS specific support.  $var _must_ be set to either true or false.
> +#ulimit -n 100000
>
>  cygwin=false;
>  darwin=false;
> @@ -130,7 +133,12 @@ if [ -z "$JAVA_HOME" ]; then
>    exit 1
>  fi
>
> +if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
> +  PID=`cat "$CARBON_HOME"/wso2carbon.pid`
> +fi
> +
>  # ----- Process the input command
> ----------------------------------------------
> +args=""
>  for c in $*
>  do
>      if [ "$c" = "--debug" ] || [ "$c" = "-debug" ] || [ "$c" = "debug" ];
> then
> @@ -140,29 +148,18 @@ do
>            if [ -z "$PORT" ]; then
>                  PORT=$c
>            fi
> -    elif [ "$c" = "--n" ] || [ "$c" = "-n" ] || [ "$c" = "n" ]; then
> -          CMD="--n"
> -          continue
> -    elif [ "$CMD" = "--n" ]; then
> -          if [ -z "$INSTANCES" ]; then
> -                INSTANCES=$c
> -          fi
>      elif [ "$c" = "--stop" ] || [ "$c" = "-stop" ] || [ "$c" = "stop" ];
> then
>            CMD="stop"
>      elif [ "$c" = "--start" ] || [ "$c" = "-start" ] || [ "$c" = "start"
> ]; then
>            CMD="start"
> -    elif [ "$c" = "--console" ] || [ "$c" = "-console" ] || [ "$c" =
> "console" ]; then
> -          CMD="console"
>      elif [ "$c" = "--version" ] || [ "$c" = "-version" ] || [ "$c" =
> "version" ]; then
>            CMD="version"
>      elif [ "$c" = "--restart" ] || [ "$c" = "-restart" ] || [ "$c" =
> "restart" ]; then
>            CMD="restart"
> -    elif [ "$c" = "--dump" ] || [ "$c" = "-dump" ] || [ "$c" = "dump" ];
> then
> -          CMD="dump"
>      elif [ "$c" = "--test" ] || [ "$c" = "-test" ] || [ "$c" = "test" ];
> then
>            CMD="test"
> -    elif [ "$c" = "--status" ] || [ "$c" = "-status" ] || [ "$c" =
> "status" ]; then
> -          CMD="status"
> +    else
> +        args="$args $c"
>      fi
>  done
>
> @@ -177,23 +174,35 @@ if [ "$CMD" = "--debug" ]; then
>    CMD="RUN"
>    JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE
> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=$PORT"
>    echo "Please start the remote debugging client to continue..."
> -elif [ "$CMD" = "--n" ]; then
> -  if [ "$INSTANCES" = "" ] || [ ! -z `echo $INSTANCES | sed 's/[0-9]//g'`
> ]]; then
> -    echo " Please specify the number of instances to start after the --n
> option"
> -    exit 1
> -  fi
>  elif [ "$CMD" = "start" ]; then
> +  if [ -e "$CARBON_HOME/wso2carbon.pid" ]; then
> +    if  ps -p $PID >&- ; then
> +      echo "Process is already running"
> +      exit 0
> +    fi
> +  fi
>    export CARBON_HOME=$CARBON_HOME
> -  nohup $CARBON_HOME/bin/stratos.sh &
> +# using nohup bash to avoid erros in solaris OS.TODO
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "stop" ]; then
>    export CARBON_HOME=$CARBON_HOME
> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
>    exit 0
>  elif [ "$CMD" = "restart" ]; then
>    export CARBON_HOME=$CARBON_HOME
> -  kill -9 `cat $CARBON_HOME/wso2carbon.pid`
> -  nohup $CARBON_HOME/bin/stratos.sh &
> +  kill -term `cat $CARBON_HOME/wso2carbon.pid`
> +  process_status=0
> +  pid=`cat $CARBON_HOME/wso2carbon.pid`
> +  while [ "$process_status" -eq "0" ]
> +  do
> +        sleep 1;
> +        ps -p$pid 2>&1 > /dev/null
> +        process_status=$?
> +  done
> +
> +# using nohup bash to avoid erros in solaris OS.TODO
> +  nohup bash $CARBON_HOME/bin/stratos.sh $args > /dev/null 2>&1 &
>    exit 0
>  elif [ "$CMD" = "test" ]; then
>      JAVACMD="exec "$JAVACMD""
> @@ -230,7 +239,10 @@ do
>          CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
>      fi
>  done
> -
> +for t in "$CARBON_HOME"/lib/commons-lang*.jar
> +do
> +    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
> +done
>  # For Cygwin, switch paths to Windows format before running java
>  if $cygwin; then
>    JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
> @@ -252,25 +264,18 @@ cd "$CARBON_HOME"
>  START_EXIT_STATUS=121
>  status=$START_EXIT_STATUS
>
> +#To monitor a Carbon server in remote JMX mode on linux host machines,
> set the below system property.
> +#   -Djava.rmi.server.hostname="your.IP.goes.here"
> +
>  while [ "$status" = "$START_EXIT_STATUS" ]
>  do
>      $JAVACMD \
> -     -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
> -     -d64 \
> -     -server \
> -     -Xms1500m -Xmx3000m \
> -     -XX:PermSize=256m -XX:MaxPermSize=512m \
> -     -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:-UseGCOverheadLimit \
> -     -XX:+CMSClassUnloadingEnabled \
> -     -XX:+OptimizeStringConcat \
> -     -XX:+HeapDumpOnOutOfMemoryError \
> -     -XX:OnOutOfMemoryError="kill -9 `echo $$`;nohup ./stratos.sh &" \
> -     -XX:HeapDumpPath=repository/logs/heap-dump.hprof \
> -     -XX:ErrorFile=repository/logs/hs_err_pid.log \
> -     -XX:OnError="nohup ./stratos.sh &" \
> +    -Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
> +    -Xms256m -Xmx1024m -XX:MaxPermSize=256m \
> +    -server \
> +    -XX:+HeapDumpOnOutOfMemoryError \
> +    -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
>      $JAVA_OPTS \
> -    -DandesConfig=qpid-config.xml \
> -    -Ddisable.cassandra.server.startup=true \
>      -Dcom.sun.management.jmxremote \
>      -classpath "$CARBON_CLASSPATH" \
>      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
> @@ -280,16 +285,20 @@ do
>      -Dcarbon.registry.root=/ \
>      -Djava.command="$JAVACMD" \
>      -Dcarbon.home="$CARBON_HOME" \
> -
>  -Dwso2.transports.xml="$CARBON_HOME/repository/conf/mgt-transports.xml" \
> -
>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/log4j.properties"
> \
> +    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
>      -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
> +
>  -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties"
> \
>      -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
> +    -Dconf.location="$CARBON_HOME/repository/conf"\
>      -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties"
> \
>      -Dcom.atomikos.icatch.hide_init_file_path=true \
>      -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
>      -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
>      -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
>      -Dorg.terracotta.quartz.skipUpdateCheck=true \
> +    -Djava.security.egd=file:/dev/./urandom \
> +    -Dfile.encoding=UTF8 \
> +    -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
>      org.wso2.carbon.bootstrap.Bootstrap $*
>      status=$?
>  done
>
>


-- 
--
Lahiru Sandaruwan
Software Engineer,
Platform Technologies,
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

email: lahirus@wso2.com cell: (+94) 773 325 954
blog: http://lahiruwrites.blogspot.com/
twitter: http://twitter.com/lahirus
linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146