[Swift-commit] r4028 - SwiftApps/SwiftR/Swift/exec

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Fri Jan 21 15:30:05 CST 2011


Author: tga
Date: 2011-01-21 15:30:05 -0600 (Fri, 21 Jan 2011)
New Revision: 4028

Modified:
   SwiftApps/SwiftR/Swift/exec/start-swift
Log:
Added helpful message for user about starting up ssh workers.
Hid unhelpful scp progress bar.



Modified: SwiftApps/SwiftR/Swift/exec/start-swift
===================================================================
--- SwiftApps/SwiftR/Swift/exec/start-swift	2011-01-21 21:10:16 UTC (rev 4027)
+++ SwiftApps/SwiftR/Swift/exec/start-swift	2011-01-21 21:30:05 UTC (rev 4028)
@@ -26,7 +26,7 @@
   fi
 
   CONTACT=$(echo $uriline | sed -e 's/^.*http:/http:/')
-  echo Coaster service contact URI: $CONTACT
+  #echo Coaster service contact URI: $CONTACT
 }
 
 function wait-and-start-ssh-workers
@@ -40,20 +40,31 @@
   IDLETIMEOUT=$((60*60*240)) # 10 days: FIXME: make this a command line arg
 
   rm -rf remotepid.* # FIXME: should not be needed if we start in a new dir each time
+  echo "Starting to launch ssh workers on hosts: $hosts"
   for host in $(echo $hosts); do
     timestamp=$(date "+%Y.%m%d.%H%M%S")
     random=$(awk "BEGIN {printf \"%0.5d\", $RANDOM}")
     ID=$timestamp.$random
        # FIXME: make logging an argument; set false by default
        # fixme:send worker.pl to remote host via stdin or scp.
-       ssh $host /bin/sh -c \'"mkdir -p $LOGDIR"\'
-       scp $SWIFTBIN/worker.pl $host:$LOGDIR
+       if ssh $host /bin/sh -c \'"mkdir -p $LOGDIR"\'
+       then 
+           if scp $SWIFTBIN/worker.pl $host:$LOGDIR > /dev/null
+           then
+               STARTCMD="WORKER_LOGGING_LEVEL=$workerLogging; $LOGDIR/worker.pl $CONTACT $ID $LOGDIR $IDLETIMEOUT 2>&1 &"'
+                            echo PGID=`ps --no-headers -o '%r' \$\$`'
+               #echo ssh $host '/bin/sh -c '\'"$STARTCMD"\'  >remotepid.$host </dev/null &
+               ssh $host '/bin/sh -c '\'"$STARTCMD"\'  >remotepid.$host </dev/null &
+               sshpids="$sshpids $!"
+               echo "Workers started on $host"
+           else
+               echo "Error sending file to $host"
+           fi
+      else
+          echo "Error contacting $host"
+      fi
 
-       STARTCMD="WORKER_LOGGING_LEVEL=$workerLogging; $LOGDIR/worker.pl $CONTACT $ID $LOGDIR $IDLETIMEOUT 2>&1 &"'
-                    echo PGID=`ps --no-headers -o '%r' \$\$`'
-       #echo ssh $host '/bin/sh -c '\'"$STARTCMD"\'  >remotepid.$host </dev/null &
-       ssh $host '/bin/sh -c '\'"$STARTCMD"\'  >remotepid.$host </dev/null &
-       sshpids="$sshpids $!"
+
   done
 
   echo Started workers from ssh processes $sshpids




More information about the Swift-commit mailing list