[Swift-commit] r7379 - in branches/release-0.95: . bin

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Thu Dec 5 11:55:22 CST 2013


Author: davidk
Date: 2013-12-05 11:55:22 -0600 (Thu, 05 Dec 2013)
New Revision: 7379

Added:
   branches/release-0.95/bin/foreachworker
Modified:
   branches/release-0.95/build.xml
Log:
foreachworker


Added: branches/release-0.95/bin/foreachworker
===================================================================
--- branches/release-0.95/bin/foreachworker	                        (rev 0)
+++ branches/release-0.95/bin/foreachworker	2013-12-05 17:55:22 UTC (rev 7379)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+SERVICE=$1
+COMMAND=$2
+
+# Verify usage
+if [ -z "$SERVICE" ] || [ -z "$COMMAND" ]; then
+   echo "Usage: $0 service_name command"
+   exit 1
+fi
+
+# Verify service is running, and get file containing URL
+URL_FILE="$HOME/.swift/service/$SERVICE/service.url"
+if [ ! -f "$URL_FILE" ]; then
+   echo "Unable to find service $SERVICE"
+   exit 1
+fi
+
+WORKERS=$( coaster-client $( cat $URL_FILE ) list workers | sed 1d | awk '{print $1}' )
+for worker in $WORKERS
+do
+   echo Running command $COMMAND on worker $worker
+   coaster-client $( cat $URL_FILE ) runcmd $worker $COMMAND > ${worker}.command.log 2>&1
+done


Property changes on: branches/release-0.95/bin/foreachworker
___________________________________________________________________
Added: svn:executable
   + *

Modified: branches/release-0.95/build.xml
===================================================================
--- branches/release-0.95/build.xml	2013-12-05 17:47:15 UTC (rev 7378)
+++ branches/release-0.95/build.xml	2013-12-05 17:55:22 UTC (rev 7379)
@@ -86,6 +86,7 @@
 		<chmod perm="+x">
 			<fileset dir="${dist.dir}/bin">
                                 <include name="apptimes"/>
+                                <include name="foreachworker"/>
 				<include name="gensites"/>
                                 <include name="prop2scs.pl"/>
 				<include name="start-coaster-service"/>




More information about the Swift-commit mailing list