diff master/bin/internal/invoke.sh @ 9:55e953e5c66f

wrun.sh, invoke.sh: add control of use of nohup, with -i(mmediately) and -w(ait) respectively wrun.sh: add support for fixed file input via -ff, handle -ff - in obvious way wbash.sh: use -ff - and -i to execute shell commands on all workers
author Henry S. Thompson <ht@markup.co.uk>
date Tue, 02 Oct 2018 10:52:45 +0000
parents a7637c994964
children 2fbefb8d1a9e
line wrap: on
line diff
--- a/master/bin/internal/invoke.sh	Mon Oct 01 18:29:39 2018 +0000
+++ b/master/bin/internal/invoke.sh	Tue Oct 02 10:52:45 2018 +0000
@@ -6,6 +6,11 @@
 #  via ssh to ip:port
 #  If ifile is not /dev/null, feed in as stdin
 #  Unless -x, worker id is passed as first arg
+if [ "$1" = "-w" ]
+then
+ shift
+ wait=1
+fi
 if [ "$1" = "-x" ]
 then
  shift
@@ -24,7 +29,10 @@
 if [ "$ifile" != "/dev/null" ]
 then
   echo "# from $ifile" 1>&2
-  scp -P $port $ifile $ip:ifile.txt && \
+  scp -P $port $ifile $ip:ifile.txt
+fi || echo scp failed, status=$? 1>&2
+if [ "$wait" ]
+then
   ssh -t -p $port $ip "nohup $cmd $id $me ""$@"" > nohup.cc"
 else
   ssh -p $port $ip "$cmd $id $me ""$@"