[Swift-commit] r4088 - SwiftApps/SwiftR/Swift/exec
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Mon Feb 14 09:52:06 CST 2011
Author: tga
Date: 2011-02-14 09:52:05 -0600 (Mon, 14 Feb 2011)
New Revision: 4088
Modified:
SwiftApps/SwiftR/Swift/exec/start-swift
Log:
bugfix: start-swift script now executes cleanup code if swift itself exits. Previously cleanup code was only executed if start-swift exited by receiving a signal.
Modified: SwiftApps/SwiftR/Swift/exec/start-swift
===================================================================
--- SwiftApps/SwiftR/Swift/exec/start-swift 2011-02-11 21:08:10 UTC (rev 4087)
+++ SwiftApps/SwiftR/Swift/exec/start-swift 2011-02-14 15:52:05 UTC (rev 4088)
@@ -468,6 +468,8 @@
out=swift.stdouterr
touch $out
+# Function to run on termination of swift
+exitcmd=""
if [ $server = local ]; then
@@ -497,10 +499,10 @@
TRAPEVENTS="EXIT 1 2 3 15" # Signals and conditions to trap
trap onexit $TRAPEVENTS
+ exitcmd=onexit
-
elif [ $server = ssh ]; then
-
+
if [ $cores -eq 0 ]; then
cores=$defaultSshCores
fi
@@ -534,6 +536,7 @@
}
trap onexit $TRAPEVENTS
+ exitcmd=onexit
wait-and-start-ssh-workers &
starterpid=$!
@@ -574,6 +577,7 @@
}
trap onexit $TRAPEVENTS
+ exitcmd=onexit
wait-and-start-batch-workers &
starterpid=$!
@@ -581,3 +585,5 @@
fi
$SWIFTRBIN/../swift/bin/swift -config cf -tc.file tc -sites.file sites.xml $script -pipedir=$(pwd) >& $out </dev/null
+
+# Do any cleanup if swift exits in this manner
More information about the Swift-commit
mailing list