From: Aaron Schulz Date: Fri, 25 Jan 2013 21:24:17 +0000 (-0800) Subject: (bug 44044) Check for existence of the timeout script in ulimit5.sh X-Git-Tag: 1.31.0-rc.0~20877^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=5c843330f8cb13ed0c6197b6b9361a6753f9e9b4;p=lhc%2Fweb%2Fwiklou.git (bug 44044) Check for existence of the timeout script in ulimit5.sh Change-Id: I89d5dd6535a6b37cadcafd12affaad1a82af22ba --- diff --git a/bin/ulimit5.sh b/bin/ulimit5.sh index 3f24172105..fd8aae2cd5 100644 --- a/bin/ulimit5.sh +++ b/bin/ulimit5.sh @@ -9,8 +9,8 @@ fi if [ "$3" -gt 0 ]; then ulimit -f "$3" fi -if [ "$4" -gt 0 ]; then - timeout $4 /bin/bash -c "$5" +if [ "$4" -gt 0 -a -x "/usr/bin/timeout" ]; then + /usr/bin/timeout $4 /bin/bash -c "$5" STATUS="$?" if [ "$STATUS" == 124 ]; then echo "ulimit5.sh: timed out." 1>&2