[Swift-commit] r6891 - SwiftApps/Swift-MapRed/swift-t-simple/put-get
wozniak at ci.uchicago.edu
wozniak at ci.uchicago.edu
Mon Aug 19 16:42:07 CDT 2013
Author: wozniak
Date: 2013-08-19 16:42:07 -0500 (Mon, 19 Aug 2013)
New Revision: 6891
Modified:
SwiftApps/Swift-MapRed/swift-t-simple/put-get/chirp_service.sh
SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift
Log:
Sketching Swift script...
Modified: SwiftApps/Swift-MapRed/swift-t-simple/put-get/chirp_service.sh
===================================================================
--- SwiftApps/Swift-MapRed/swift-t-simple/put-get/chirp_service.sh 2013-08-19 21:21:32 UTC (rev 6890)
+++ SwiftApps/Swift-MapRed/swift-t-simple/put-get/chirp_service.sh 2013-08-19 21:42:07 UTC (rev 6891)
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/bash
trap "echo SCRIPT CAUGHT TERM" TERM
@@ -7,12 +7,25 @@
# This should have been created by setup.sh:
DEFAULT_ACL=${HOME}/chirp-acl.txt
-[[ -f ${DEFAULT_ACL} ]]
+if [[ ! -f ${DEFAULT_ACL} ]]
+then
+ echo "could not find ${DEFAULT_ACL}"
+ exit 1
+fi
-chirp_server -p 9080 -r ${HOME}/cr_${HOST} -A ${DEFAULT_ACL} &
+CHIRP_ROOT=${HOME}/cr_${HOST}
+
+chirp_server -d all \
+ -p 9080 \
+ -r ${CHIRP_ROOT} \
+ -A ${DEFAULT_ACL} \
+ >& ${CHIRP_ROOT}/server.log &
+
JOB=${!}
-wait
+wait || true
kill ${JOB}
+echo SERVICE DONE
+
exit 0
Modified: SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift
===================================================================
--- SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift 2013-08-19 21:21:32 UTC (rev 6890)
+++ SwiftApps/Swift-MapRed/swift-t-simple/put-get/test-chirp.swift 2013-08-19 21:42:07 UTC (rev 6891)
@@ -4,15 +4,40 @@
import string;
import sys;
+
+
+app (file t) list_files(string host, int port)
+{
+ "chirp" "-a" "hostname" (sprintf("%s:%i", host, port)) "ls"
+ @stdout=t;
+}
+
main
{
- string hosts_txt = argv("hosts");
+/* string hosts_txt = argv("hosts");
+ int port = toint(argv("port"));
+
string hosts[] = split(read(input(hosts_txt)), "\n");
- foreach host in hosts
+
+ string filenames[][];
+
+ foreach host,i in hosts
{
if (host != "")
{
printf("host: %s", host);
+ file t = list_files(host, port);
+ string s = read(t);
+ string files[] = split(s, " ");
+ // foreach f,j in files
+ // {
+ // if (f != "")
+ // {
+ // filenames[i][j] = f;
+ // }
+ // }
}
}
+*/
+ sleep(2);
}
More information about the Swift-commit
mailing list