From: "Richard W.M. Jones" <rjones(a)redhat.com>
If timeout doesn't have the -k option, don't use it.
(cherry picked from commit 8d68f1c5ceb5ac613393654bde58127e50c0f7bf)
---
run.in | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/run.in b/run.in
index bd10d4e..5ab008b 100755
--- a/run.in
+++ b/run.in
@@ -204,12 +204,17 @@ fi
# Originally 1h, but that is not long enough to run the C API
# tests on Koji.
timeout_period=4h
+timeout_kill=30s
# Do we have Padraig's timeout utility (from coreutils)?
if timeout --help >/dev/null 2>&1; then
+ # Does this version of timeout have the -k option? (Not on RHEL 6)
+ if timeout -k 10s 10s true >/dev/null 2>&1; then
+ timeout_k_opt="-k $timeout_kill"
+ fi
# Timeout (SIGTERM) after $timeout_period.
- # Then send a second SIGKILL 30 seconds later.
- timeout="timeout -k 30s $timeout_period"
+ # Then send a second SIGKILL $timeout_kill seconds later.
+ timeout="timeout $timeout_k_opt $timeout_period"
fi
pid=$$
--
1.8.3.1