[jboss-cvs] JBossAS SVN: r88441 - in projects/jboss-osgi/trunk/build: distribution/runtime/conf and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 8 10:30:44 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-05-08 10:30:43 -0400 (Fri, 08 May 2009)
New Revision: 88441

Added:
   projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/
   projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/run-with-pid.sh
   projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/runtime.sh
Removed:
   projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/jboss.sh
   projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/runjboss.sh
   projects/jboss-osgi/trunk/build/hudson/jboss/
Modified:
   projects/jboss-osgi/trunk/build/distribution/runtime/bin/run.sh
   projects/jboss-osgi/trunk/build/distribution/runtime/conf/log4j.xml
   projects/jboss-osgi/trunk/build/hudson/hudson-home/command.sh
Log:
refactor container startup

Modified: projects/jboss-osgi/trunk/build/distribution/runtime/bin/run.sh
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/runtime/bin/run.sh	2009-05-08 14:17:08 UTC (rev 88440)
+++ projects/jboss-osgi/trunk/build/distribution/runtime/bin/run.sh	2009-05-08 14:30:43 UTC (rev 88441)
@@ -142,5 +142,7 @@
 # Execute the JVM in the foreground
 "$JAVA" $JAVA_OPTS \
   -classpath "$OSGI_CLASSPATH" \
-  org.jboss.osgi.spi.framework.OSGiBootstrap "$@"
+  org.jboss.osgi.spi.framework.OSGiBootstrap "$@" &> /dev/null &
+  echo $! > $OSGI_HOME/bin/pid.txt
+  fg
 OSGI_STATUS=$?

Modified: projects/jboss-osgi/trunk/build/distribution/runtime/conf/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/runtime/conf/log4j.xml	2009-05-08 14:17:08 UTC (rev 88440)
+++ projects/jboss-osgi/trunk/build/distribution/runtime/conf/log4j.xml	2009-05-08 14:30:43 UTC (rev 88441)
@@ -8,7 +8,7 @@
   <!-- ================================= -->
 
   <appender name="FILE" class="org.apache.log4j.FileAppender">
-    <param name="File" value="${osgi.home}/log/test.log"/>
+    <param name="File" value="${osgi.home}/log/server.log"/>
     <param name="Append" value="false"/>
     <layout class="org.apache.log4j.PatternLayout">
       <!-- The default pattern: Date Priority [Category] Message\n -->

Copied: projects/jboss-osgi/trunk/build/hudson/hudson-home/bin (from rev 88424, projects/jboss-osgi/trunk/build/hudson/jboss/bin)

Deleted: projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/jboss.sh
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/jboss/bin/jboss.sh	2009-05-08 12:00:24 UTC (rev 88424)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/jboss.sh	2009-05-08 14:30:43 UTC (rev 88441)
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-PROGNAME=`basename $0`
-DIRNAME=`dirname $0`
-JBOSS_HOME="$1"
-BINDADDR="$3"
-CMD="$2"
-
-export JBOSS_HOME
-
-#
-# Helper to complain.
-#
-warn() {
-   echo "$PROGNAME: $*"
-}
-
-if [ ! -f "$JBOSS_HOME/bin/run.sh" ]; then
-   warn "Cannot find: $JBOSS_HOME/bin/run.sh"
-   exit 1
-fi
-
-case "$CMD" in
-start)
-    # This version of run.sh obtains the pid of the JVM and saves it as jboss.pid
-    # It relies on bash specific features
-    # Do you want to hide jboss output?
-    /bin/bash $DIRNAME/runjboss.sh -b $BINDADDR &
-    ;;
-stop)
-    pidfile="$JBOSS_HOME/bin/jboss.pid"
-    if [ -f "$pidfile" ]; then
-       pid=`cat "$pidfile"`
-       echo "kill pid: $pid"
-       kill $pid
-       if [ "$?" -eq 0 ]; then
-         # process exists, wait for it to die, and force if not
-         sleep 20
-         kill -9 $pid &> /dev/null
-       fi
-       rm "$pidfile"
-    else
-       warn "No pid found, using shutdown"
-       $JBOSS_HOME/bin/shutdown.sh -S > /dev/null &
-    fi
-    ;;
-restart)
-    $0 stop
-    $0 start
-    ;;
-*)
-    echo "usage: $0 jboss_instance (start|stop|restart|help)"
-esac

Copied: projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/run-with-pid.sh (from rev 88424, projects/jboss-osgi/trunk/build/hudson/jboss/bin/runjboss.sh)
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/run-with-pid.sh	                        (rev 0)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/run-with-pid.sh	2009-05-08 14:30:43 UTC (rev 88441)
@@ -0,0 +1,136 @@
+#!/bin/bash
+### ====================================================================== ###
+##                                                                          ##
+##  JBoss Bootstrap Script                                                  ##
+##                                                                          ##
+### ====================================================================== ###
+
+### $Id$ ###
+
+DIRNAME=`dirname $0`
+PROGNAME=`basename $0`
+GREP="grep"
+
+# Use the maximum available, or set MAX_FD != -1 to use that
+MAX_FD="maximum"
+
+#
+# Helper to complain.
+#
+warn() {
+    echo "${PROGNAME}: $*"
+}
+
+#
+# Helper to puke.
+#
+die() {
+    warn $*
+    exit 1
+}
+
+# Setup JBOSS_HOME
+if [ "x$JBOSS_HOME" = "x" ]; then
+    # get the full path (without any relative bits)
+    JBOSS_HOME=`cd $DIRNAME/..; pwd`
+fi
+export JBOSS_HOME
+
+# Read an optional running configuration file
+if [ "x$RUN_CONF" = "x" ]; then
+    RUN_CONF="$JBOSS_HOME/bin/run.conf"
+fi
+if [ -r "$RUN_CONF" ]; then
+    . "$RUN_CONF"
+fi
+
+# Setup the JVM
+if [ "x$JAVA" = "x" ]; then
+    if [ "x$JAVA_HOME" != "x" ]; then
+	JAVA="$JAVA_HOME/bin/java"
+    else
+	JAVA="java"
+    fi
+fi
+
+# Setup the classpath
+runjar="$JBOSS_HOME/bin/run.jar"
+if [ ! -f "$runjar" ]; then
+    die "Missing required file: $runjar"
+fi
+JBOSS_BOOT_CLASSPATH="$runjar"
+
+# Include the JDK javac compiler for JSP pages. The default is for a Sun JDK
+# compatible distribution which JAVA_HOME points to
+if [ "x$JAVAC_JAR" = "x" ]; then
+    JAVAC_JAR="$JAVA_HOME/lib/tools.jar"
+fi
+if [ ! -f "$JAVAC_JAR" ]; then
+   warn "Missing file: $JAVAC_JAR"
+   warn "Unexpected results may occur.  Make sure JAVA_HOME points to a JDK and not a JRE."
+fi
+
+if [ "x$JBOSS_CLASSPATH" = "x" ]; then
+    JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH:$JAVAC_JAR"
+else
+    JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH:$JAVAC_JAR"
+fi
+
+# If -server not set in JAVA_OPTS, set it, if supported
+SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`
+if [ "x$SERVER_SET" = "x" ]; then
+
+    # Check for SUN(tm) JVM w/ HotSpot support
+    if [ "x$HAS_HOTSPOT" = "x" ]; then
+	HAS_HOTSPOT=`"$JAVA" -version 2>&1 | $GREP -i HotSpot`
+    fi
+
+    # Enable -server if we have Hotspot, unless we can't
+    if [ "x$HAS_HOTSPOT" != "x" ]; then
+    JAVA_OPTS="-server $JAVA_OPTS"
+    fi
+fi
+
+# Setup JBoss sepecific properties
+JAVA_OPTS="-Dprogram.name=$PROGNAME $JAVA_OPTS"
+
+# Force IPv4 on Linux systems since IPv6 doesn't work correctly with jdk5 and lower
+JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
+
+# This should be removed when JBoss configuration XML files can be validated JBAS-6744
+JAVA_OPTS="$JAVA_OPTS -Dxb.builder.useUnorderedSequence=true"
+
+# Setup the java endorsed dirs
+JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed"
+
+# Display our environment
+echo "========================================================================="
+echo ""
+echo "  JBoss Bootstrap Environment"
+echo ""
+echo "  JBOSS_HOME: $JBOSS_HOME"
+echo ""
+echo "  JAVA: $JAVA"
+echo ""
+echo "  JAVA_OPTS: $JAVA_OPTS"
+echo ""
+echo "  CLASSPATH: $JBOSS_CLASSPATH"
+echo ""
+echo "========================================================================="
+echo ""
+# enable monitor mode (job control needed)
+set -m
+STATUS=10
+while [ $STATUS -eq 10 ]
+do
+# Execute the JVM
+   "$JAVA" $JAVA_OPTS \
+      -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
+      -classpath "$JBOSS_CLASSPATH" \
+      org.jboss.Main "$@" &> /dev/null &
+      echo $! > $JBOSS_HOME/bin/pid.txt
+      fg
+   STATUS=$?
+   # if it doesn't work, you may want to take a look at this:
+   #    http://developer.java.sun.com/developer/bugParade/bugs/4465334.html
+done

Deleted: projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/runjboss.sh
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/jboss/bin/runjboss.sh	2009-05-08 12:00:24 UTC (rev 88424)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/runjboss.sh	2009-05-08 14:30:43 UTC (rev 88441)
@@ -1,136 +0,0 @@
-#!/bin/bash
-### ====================================================================== ###
-##                                                                          ##
-##  JBoss Bootstrap Script                                                  ##
-##                                                                          ##
-### ====================================================================== ###
-
-### $Id$ ###
-
-DIRNAME=`dirname $0`
-PROGNAME=`basename $0`
-GREP="grep"
-
-# Use the maximum available, or set MAX_FD != -1 to use that
-MAX_FD="maximum"
-
-#
-# Helper to complain.
-#
-warn() {
-    echo "${PROGNAME}: $*"
-}
-
-#
-# Helper to puke.
-#
-die() {
-    warn $*
-    exit 1
-}
-
-# Setup JBOSS_HOME
-if [ "x$JBOSS_HOME" = "x" ]; then
-    # get the full path (without any relative bits)
-    JBOSS_HOME=`cd $DIRNAME/..; pwd`
-fi
-export JBOSS_HOME
-
-# Read an optional running configuration file
-if [ "x$RUN_CONF" = "x" ]; then
-    RUN_CONF="$JBOSS_HOME/bin/run.conf"
-fi
-if [ -r "$RUN_CONF" ]; then
-    . "$RUN_CONF"
-fi
-
-# Setup the JVM
-if [ "x$JAVA" = "x" ]; then
-    if [ "x$JAVA_HOME" != "x" ]; then
-	JAVA="$JAVA_HOME/bin/java"
-    else
-	JAVA="java"
-    fi
-fi
-
-# Setup the classpath
-runjar="$JBOSS_HOME/bin/run.jar"
-if [ ! -f "$runjar" ]; then
-    die "Missing required file: $runjar"
-fi
-JBOSS_BOOT_CLASSPATH="$runjar"
-
-# Include the JDK javac compiler for JSP pages. The default is for a Sun JDK
-# compatible distribution which JAVA_HOME points to
-if [ "x$JAVAC_JAR" = "x" ]; then
-    JAVAC_JAR="$JAVA_HOME/lib/tools.jar"
-fi
-if [ ! -f "$JAVAC_JAR" ]; then
-   warn "Missing file: $JAVAC_JAR"
-   warn "Unexpected results may occur.  Make sure JAVA_HOME points to a JDK and not a JRE."
-fi
-
-if [ "x$JBOSS_CLASSPATH" = "x" ]; then
-    JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH:$JAVAC_JAR"
-else
-    JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH:$JAVAC_JAR"
-fi
-
-# If -server not set in JAVA_OPTS, set it, if supported
-SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`
-if [ "x$SERVER_SET" = "x" ]; then
-
-    # Check for SUN(tm) JVM w/ HotSpot support
-    if [ "x$HAS_HOTSPOT" = "x" ]; then
-	HAS_HOTSPOT=`"$JAVA" -version 2>&1 | $GREP -i HotSpot`
-    fi
-
-    # Enable -server if we have Hotspot, unless we can't
-    if [ "x$HAS_HOTSPOT" != "x" ]; then
-    JAVA_OPTS="-server $JAVA_OPTS"
-    fi
-fi
-
-# Setup JBoss sepecific properties
-JAVA_OPTS="-Dprogram.name=$PROGNAME $JAVA_OPTS"
-
-# Force IPv4 on Linux systems since IPv6 doesn't work correctly with jdk5 and lower
-JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
-
-# This should be removed when JBoss configuration XML files can be validated JBAS-6744
-JAVA_OPTS="$JAVA_OPTS -Dxb.builder.useUnorderedSequence=true"
-
-# Setup the java endorsed dirs
-JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed"
-
-# Display our environment
-echo "========================================================================="
-echo ""
-echo "  JBoss Bootstrap Environment"
-echo ""
-echo "  JBOSS_HOME: $JBOSS_HOME"
-echo ""
-echo "  JAVA: $JAVA"
-echo ""
-echo "  JAVA_OPTS: $JAVA_OPTS"
-echo ""
-echo "  CLASSPATH: $JBOSS_CLASSPATH"
-echo ""
-echo "========================================================================="
-echo ""
-# enable monitor mode (job control needed)
-set -m
-STATUS=10
-while [ $STATUS -eq 10 ]
-do
-# Execute the JVM
-   "$JAVA" $JAVA_OPTS \
-      -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-      -classpath "$JBOSS_CLASSPATH" \
-      org.jboss.Main "$@" &> /dev/null &
-      echo $! > $JBOSS_HOME/bin/jboss.pid
-      fg
-   STATUS=$?
-   # if it doesn't work, you may want to take a look at this:
-   #    http://developer.java.sun.com/developer/bugParade/bugs/4465334.html
-done

Copied: projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/runtime.sh (from rev 88424, projects/jboss-osgi/trunk/build/hudson/jboss/bin/jboss.sh)
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/runtime.sh	                        (rev 0)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/bin/runtime.sh	2009-05-08 14:30:43 UTC (rev 88441)
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+RUNTIME_HOME="$1"
+BINDADDR="$3"
+CMD="$2"
+
+export RUNTIME_HOME
+
+#
+# Helper to complain.
+#
+warn() {
+   echo "$PROGNAME: $*"
+}
+
+if [ ! -f "$RUNTIME_HOME/bin/run.sh" ]; then
+   warn "Cannot find: $RUNTIME_HOME/bin/run.sh"
+   exit 1
+fi
+
+case "$CMD" in
+start)
+    # This version of run.sh obtains the pid of the JVM and saves it as jboss.pid
+    # It relies on bash specific features
+    /bin/bash $RUNTIME_HOME/bin/run.sh -b $BINDADDR &
+    ;;
+stop)
+    pidfile="$RUNTIME_HOME/bin/pid.txt"
+    if [ -f "$pidfile" ]; then
+       pid=`cat "$pidfile"`
+       echo "kill pid: $pid"
+       kill $pid
+       if [ "$?" -eq 0 ]; then
+         # process exists, wait for it to die, and force if not
+         sleep 20
+         kill -9 $pid &> /dev/null
+       fi
+       rm "$pidfile"
+    else
+       warn "No pid found!"
+    fi
+    ;;
+restart)
+    $0 stop
+    $0 start
+    ;;
+*)
+    echo "usage: $0 jboss_home (start|stop|restart|help)"
+esac

Modified: projects/jboss-osgi/trunk/build/hudson/hudson-home/command.sh
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/hudson-home/command.sh	2009-05-08 14:17:08 UTC (rev 88440)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/command.sh	2009-05-08 14:30:43 UTC (rev 88441)
@@ -15,23 +15,33 @@
   'jboss501')
     JBOSS_BUILD=jboss-5.0.1.GA
     JBOSS_ZIP=$HUDSON_HOME/../jboss/$JBOSS_BUILD.zip
-	JBOSS_HOME=$WORKSPACE/$JBOSS_BUILD
-    rm -rf $JBOSS_HOME; unzip -q $JBOSS_ZIP -d $WORKSPACE  
+	RUNTIME_HOME=$WORKSPACE/$JBOSS_BUILD
+	RUNTIME_LOG=$RUNTIME_HOME/server/$JBOSS_SERVER/log/server.log
+    rm -rf $RUNTIME_HOME; unzip -q $JBOSS_ZIP -d $WORKSPACE  
+    cp $RUNTIME_HOME/bin/run.sh $RUNTIME_HOME/bin/run.sh.org
+    cp $HUDSONDIR/bin/run-with-pid.sh $RUNTIME_HOME/bin/run.sh
   ;;
   'jboss510')
     JBOSS_BUILD=jboss-5.1.0.GA
     JBOSS_ZIP=$HUDSON_HOME/../jboss/$JBOSS_BUILD.zip
-	JBOSS_HOME=$WORKSPACE/$JBOSS_BUILD
-    rm -rf $JBOSS_HOME; unzip -q $JBOSS_ZIP -d $WORKSPACE  
+	RUNTIME_HOME=$WORKSPACE/$JBOSS_BUILD
+	RUNTIME_LOG=$RUNTIME_HOME/server/$JBOSS_SERVER/log/server.log
+    rm -rf $RUNTIME_HOME; unzip -q $JBOSS_ZIP -d $WORKSPACE  
+    cp $RUNTIME_HOME/bin/run.sh $RUNTIME_HOME/bin/run.sh.org
+    cp $HUDSONDIR/bin/run-with-pid.sh $RUNTIME_HOME/bin/run.sh
   ;;
   'jboss600')
     JBOSS_BUILD=jboss-6.0.0.Alpha1
     JBOSS_ZIP=$HUDSON_HOME/../jboss/$JBOSS_BUILD.zip
-	JBOSS_HOME=$WORKSPACE/$JBOSS_BUILD
-    rm -rf $JBOSS_HOME; unzip -q $JBOSS_ZIP -d $WORKSPACE  
+	RUNTIME_HOME=$WORKSPACE/$JBOSS_BUILD
+	RUNTIME_LOG=$RUNTIME_HOME/server/$JBOSS_SERVER/log/server.log
+    rm -rf $RUNTIME_HOME; unzip -q $JBOSS_ZIP -d $WORKSPACE
+    cp $RUNTIME_HOME/bin/run.sh $RUNTIME_HOME/bin/run.sh.org
+    cp $HUDSONDIR/bin/run-with-pid.sh $RUNTIME_HOME/bin/run.sh
   ;;
   'runtime')
-	JBOSS_HOME=$DISTRODIR/auto-install-dest/runtime
+	RUNTIME_HOME=$DISTRODIR/auto-install-dest/runtime
+	RUNTIME_LOG=$RUNTIME_HOME/log/server.log
   ;;
   *)
 	echo "Unsupported container: $CONTAINER"
@@ -39,7 +49,7 @@
   ;;
 esac
 
-ENVIRONMENT="-Dframework=$FRAMEWORK -Dtarget.container=$CONTAINER -Djboss.home=$JBOSS_HOME -Djboss.bind.address=$JBOSS_BINDADDR"
+ENVIRONMENT="-Dframework=$FRAMEWORK -Dtarget.container=$CONTAINER -Djboss.home=$RUNTIME_HOME -Djboss.bind.address=$JBOSS_BINDADDR"
 
 #
 # Build distro
@@ -61,25 +71,25 @@
 echo $JAVA_CMD; $JAVA_CMD 
 
 #
+# log dependency tree
+#
+MVN_CMD="mvn -o $ENVIRONMENT dependency:tree"
+echo $MVN_CMD; $MVN_CMD | tee $WORKSPACE/dependency-tree.txt
+
+#
 # start jbossas
 #
-$HUDSONDIR/jboss/bin/jboss.sh $JBOSS_HOME start $JBOSS_BINDADDR
+$HUDSONDIR/bin/runtime.sh $RUNTIME_HOME start $JBOSS_BINDADDR
 
 # Was it successfully started?
-$HUDSONDIR/jboss/bin/http-spider.sh $JBOSS_BINDADDR:8090/jboss-osgi $WORKSPACE
+$HUDSONDIR/bin/http-spider.sh $JBOSS_BINDADDR:8090/jboss-osgi $WORKSPACE
 if [ -e $WORKSPACE/spider.failed ]; then
-  tail -n 200 $JBOSS_HOME/server/$JBOSS_SERVER/log/server.log
-  $HUDSONDIR/jboss/bin/jboss.sh $JBOSS_HOME stop $JBOSS_BINDADDR
+  tail -n 200 $RUNTIME_LOG
+  $HUDSONDIR/bin/runtime.sh $RUNTIME_HOME stop
   exit 1
 fi
 
 #
-# log dependency tree
-#
-MVN_CMD="mvn -o $ENVIRONMENT dependency:tree"
-echo $MVN_CMD; $MVN_CMD | tee $WORKSPACE/dependency-tree.txt
-
-#
 # execute tests
 #
 MVN_CMD="mvn -o -fae $ENVIRONMENT test"
@@ -90,9 +100,7 @@
 #
 # stop jbossas
 #
-$HUDSONDIR/jboss/bin/jboss.sh $JBOSS_HOME stop
-cp $JBOSS_HOME/server/$JBOSS_SERVER/log/boot.log $WORKSPACE/jboss-boot.log
-cp $JBOSS_HOME/server/$JBOSS_SERVER/log/server.log $WORKSPACE/jboss-server.log
+$HUDSONDIR/bin/runtime.sh $RUNTIME_HOME stop
 
 #
 # copy test.log to workspace




More information about the jboss-cvs-commits mailing list