Browse files

save a fork; collect unclean exit status file; check if scanslaves ar…

…e alive before chunking
  • Loading branch information...
1 parent 3a07b37 commit 26a40d9e3c26b2d1acc8e5def73fd44d1aa4ddb3 @jschauma committed May 5, 2011
Showing with 28 additions and 3 deletions.
  1. +5 −0 CHANGES
  2. +2 −2 helpers/generic-aggregator
  3. +1 −1 src/checkhosts
  4. +20 −0 src/scanmaster
View
5 CHANGES
@@ -1,3 +1,8 @@
+Version 3.1.6 (2011-05-22)
+ * save a fork by obliterating a UUOC
+ * collect unclean exit status files in the generic aggregator
+ * check if scanslaves are alive before chunking
+
Version 3.1.5 (2011-03-01)
* display time it took and number of hosts scanned
View
4 helpers/generic-aggregator
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: generic-aggregator 72 2011-02-02 23:31:11Z jans $
+# $Id: generic-aggregator 106 2011-05-05 22:40:52Z jans $
# $URL: svn+ssh://svn.corp.yahoo.com/yahoo/tools/scanmaster/scanner/branches/public/helpers/generic-aggregator $
#
# Copyright (c) 2008 Yahoo! Inc.
@@ -28,7 +28,7 @@ outdir=${BASEDIR:-/mnt/scanmaster}/${USER}/${name}-not-yet/${date}/${suffix}
# cat */*/*/hosts_checked might be too many files for the shell,
# so find(1) them instead.
- find ${prefix}/${date}* \( ! -name 'hosts_ok' -and -name 'hosts_*' \) | while read filename; do
+ find ${prefix}/${date}* \( ! -name 'hosts_ok' -and -name 'hosts_*' -or -name 'exit_*' \) | while read filename; do
f="${filename##*/hosts_}"
cat ${filename} >> ${prefix}/final/${f}
done
View
2 src/checkhosts
@@ -177,7 +177,7 @@ checkhost () {
host_output=$(${SSH_WRAPPER} ${sshopts} ${SSHOPTS} ${target} "${rcmd}")
else
- host_output=$(cat ${SCRIPT} | ${SSH_WRAPPER} ${sshopts} ${SSHOPTS} ${target} "${remote_shell}")
+ host_output=$(${SSH_WRAPPER} ${sshopts} ${SSHOPTS} ${target} "${remote_shell}" < ${SCRIPT})
fi
rval=$?
View
20 src/scanmaster
@@ -74,6 +74,25 @@ PREFIX=""
### Subroutines
###
+# function : checkWorkerHosts
+# purpose : make sure that the entries in the WHOSTS file appear to be up
+# and running
+# inputs : none
+# returns : nothing; creates a local worker hosts file and sets the
+# WHOSTS variable to point to that
+
+checkWorkerHosts() {
+ local whosts="${PREFIX}/.whosts"
+ rm -f ${whosts} >/dev/null 2>&1
+ for h in $(sed -e 's/#.*//' ${WHOSTS}); do
+ ping -c 1 -i 1 -t 3 -q ${h} >/dev/null 2>&1 && {
+ echo "${h}" >> ${whosts}
+ }
+ done
+ export WHOSTS="${whosts}"
+}
+
+
# function : farmOutJobs
# purpose : set up a screenrc on each of our worker hosts, then invoke it
# note: user needs to detach from each host's screen session
@@ -196,6 +215,7 @@ prescanTasks() {
date > ${PREFIX}/started
+ checkWorkerHosts
NUM_HOSTS=$(wc -l <${WHOSTS})
}

0 comments on commit 26a40d9

Please sign in to comment.