pespin submitted this change.

View Change

Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve
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.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6f3f6218095643609a8b8869b57dde6b6bdb77a0
Gerrit-Change-Number: 38847
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>