pespin submitted this change.
testenv: respawn.sh: don't respawn on segfault
Do not respawn the process if it segfaulted or aborted abnormally in
another way (exit code >= 128).
Change-Id: I6f3f6218095643609a8b8869b57dde6b6bdb77a0
---
M _testenv/data/scripts/respawn.sh
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/_testenv/data/scripts/respawn.sh b/_testenv/data/scripts/respawn.sh
index 3b079c7..1036569 100755
--- a/_testenv/data/scripts/respawn.sh
+++ b/_testenv/data/scripts/respawn.sh
@@ -12,7 +12,12 @@
$* &
LAST_PID=$!
wait $LAST_PID
- echo "respawn: $i: stopped pid $LAST_PID with status $?"
+ LAST_STATUS=$?
+ echo "respawn: $i: stopped pid $LAST_PID with status $LAST_STATUS"
+ if [ $LAST_STATUS -ge 128 ]; then
+ echo "respawn: process was terminated abnormally, not respawning"
+ exit $LAST_STATUS
+ fi
if [ $SLEEP_BEFORE_RESPAWN -gt 0 ]; then
echo "respawn: sleeping $SLEEP_BEFORE_RESPAWN seconds..."
sleep $SLEEP_BEFORE_RESPAWN
To view, visit change 38847. To unsubscribe, or for help writing mail filters, visit settings.