servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r901591 - /servicemix/smx3/trunk/distributions/apache-servicemix/src/main/release/bin/servicemix
Date Thu, 21 Jan 2010 08:27:20 GMT
Author: jbonofre
Date: Thu Jan 21 08:27:10 2010
New Revision: 901591

URL: http://svn.apache.org/viewvc?rev=901591&view=rev
Log:
[SM-788] start/stop/restart support in the servicemix launcher script.

Modified:
    servicemix/smx3/trunk/distributions/apache-servicemix/src/main/release/bin/servicemix

Modified: servicemix/smx3/trunk/distributions/apache-servicemix/src/main/release/bin/servicemix
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/distributions/apache-servicemix/src/main/release/bin/servicemix?rev=901591&r1=901590&r2=901591&view=diff
==============================================================================
--- servicemix/smx3/trunk/distributions/apache-servicemix/src/main/release/bin/servicemix
(original)
+++ servicemix/smx3/trunk/distributions/apache-servicemix/src/main/release/bin/servicemix
Thu Jan 21 08:27:10 2010
@@ -290,28 +290,85 @@
         CYGHOME=`cygpath --windows "$HOME"`
     fi
     
-    cd $SERVICEMIX_DATA
-    # Execute the Java Virtual Machine
-    # echo $JAVA \
-    #     $JAVA_OPTS \
-    #     $SERVICEMIX_OPTS \
-    #     -classpath "$CLASSPATH" \
-    #     -Dclassworlds.conf="$CLASSWORLDS_CONF" \
-    #     -Dservicemix.home="$SERVICEMIX_HOME" \
-    #     -Dcygwin.user.home="$CYGHOME" \
-    #     -Djava.endorsed.dirs="$SERVICEMIX_HOME/lib/endorsed" \
-    #     org.codehaus.classworlds.Launcher \
-    #     "$@"        
-    exec $JAVA \
-        $JAVA_OPTS \
-        $SERVICEMIX_OPTS \
-        -classpath "$CLASSPATH" \
-        -Dclassworlds.conf="$CLASSWORLDS_CONF" \
-        -Dservicemix.home="$SERVICEMIX_HOME" \
-        -Dcygwin.user.home="$CYGHOME" \
-        -Djava.endorsed.dirs="$SERVICEMIX_HOME/lib/endorsed" \
-        org.codehaus.classworlds.Launcher \
-        "$@"      
+    # if the first arg is start/stop/restart, manage it
+    case "$1" in
+        'start')
+                # go into ServiceMix home
+                cd $SERVICEMIX_HOME
+                
+                # shift on the arguments
+                shift
+                
+                # Execute the Java Virtual Machine
+                # echo $JAVA \
+                #     $JAVA_OPTS \
+                #     $SERVICEMIX_OPTS \
+                #     -classpath "$CLASSPATH" \
+                #     -Dclassworlds.conf="$CLASSWORLDS_CONF" \
+                #     -Dservicemix.home="$SERVICEMIX_HOME" \
+                #     -Dcygwin.user.home="$CYGHOME" \
+                #     -Djava.endorsed.dirs="$SERVICEMIX_HOME/lib/endorsed" \
+                #     org.codehaus.classworlds.Launcher \
+                #     "$@"        
+                exec $JAVA \
+                    $JAVA_OPTS \
+                    $SERVICEMIX_OPTS \
+                    -classpath "$CLASSPATH" \
+                    -Dclassworlds.conf="$CLASSWORLDS_CONF" \
+                    -Dservicemix.home="$SERVICEMIX_HOME" \
+                    -Dcygwin.user.home="$CYGHOME" \
+                    -Djava.endorsed.dirs="$SERVICEMIX_HOME/lib/endorsed" \
+                    org.codehaus.classworlds.Launcher \
+                    "$@" &
+                    
+                echo $! > $SERVICEMIX_HOME/data/servicemix.pid
+                exit 0               
+                ;;
+        'stop')
+            if [ -f $SERVICEMIX_HOME/data/servicemix.pid ]; then
+                read pid < $SERVICEMIX_HOME/data/servicemix.pid
+                kill $pid
+                rm $SERVICEMIX_HOME/data/servicemix.pid
+                echo "Apache ServiceMix stopped.";
+                exit 0
+            else
+                echo ""
+                echo "Apache ServiceMix PID file not found.";
+                exit 1
+            fi
+            ;;
+        'restart')
+            $0 stop
+            $0 start
+            ;;               
+        *)
+            # go into ServiceMix data
+            cd $SERVICEMIX_DATA
+            
+            # Execute the Java Virtual Machine
+            # echo $JAVA \
+            #     $JAVA_OPTS \
+            #     $SERVICEMIX_OPTS \
+            #     -classpath "$CLASSPATH" \
+            #     -Dclassworlds.conf="$CLASSWORLDS_CONF" \
+            #     -Dservicemix.home="$SERVICEMIX_HOME" \
+            #     -Dcygwin.user.home="$CYGHOME" \
+            #     -Djava.endorsed.dirs="$SERVICEMIX_HOME/lib/endorsed" \
+            #     org.codehaus.classworlds.Launcher \
+            #     "$@"        
+            exec $JAVA \
+                $JAVA_OPTS \
+                $SERVICEMIX_OPTS \
+                -classpath "$CLASSPATH" \
+                -Dclassworlds.conf="$CLASSWORLDS_CONF" \
+                -Dservicemix.home="$SERVICEMIX_HOME" \
+                -Dcygwin.user.home="$CYGHOME" \
+                -Djava.endorsed.dirs="$SERVICEMIX_HOME/lib/endorsed" \
+                org.codehaus.classworlds.Launcher \
+                "$@" 
+            ;;
+    esac
+    
 }
 
 main() {



Mime
View raw message