From 4fadfbbc27d3fba5c66f02ee894dd8029689ac49 Mon Sep 17 00:00:00 2001 From: arnej27959 Date: Fri, 1 Jul 2016 12:48:25 +0200 Subject: handle sh != bash case better --- vespamalloc/src/tests/thread/thread_test.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'vespamalloc') diff --git a/vespamalloc/src/tests/thread/thread_test.sh b/vespamalloc/src/tests/thread/thread_test.sh index 7d9a0bedd86..3af29ad052e 100755 --- a/vespamalloc/src/tests/thread/thread_test.sh +++ b/vespamalloc/src/tests/thread/thread_test.sh @@ -1,7 +1,17 @@ #!/bin/bash set -e -ulimit -u 31215 +echo "Trying to find limit for processes:" +if ulimit -u; then + echo "Fixing limit to 31215" + ulimit -u 31215 +elif [ "$RETRYEXEC" ]; then + echo "Already tried to re-exec script, giving up." + exit 1 +else + echo "Command 'ulimit -u' failed, trying to re-exec script with bash instead." + exec /usr/bin/env RETRYEXEC=true bash $0 +fi VESPA_MALLOC_SO=../../../src/vespamalloc/libvespamalloc.so VESPA_MALLOC_SO_D=../../../src/vespamalloc/libvespamalloc_vespamallocd.so -- cgit v1.2.3