From: brian Date: Wed, 2 Nov 2005 17:53:51 +0000 (+0000) Subject: Make sure update_oldconfig does not hang the whole works. X-Git-Tag: 1.4.10~393 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=7e6d714c8b58465e8f946c37cc78b06077fee23c;p=fs%2Flustre-release.git Make sure update_oldconfig does not hang the whole works. --- diff --git a/build/lmake b/build/lmake index 40263ed..34b03eb 100755 --- a/build/lmake +++ b/build/lmake @@ -341,6 +341,23 @@ set_make() MAKE_J="$MAKE -j $JOBS" } +timed_run() { + SLEEP_TIME=$1 + shift + + set -o monitor + + #bash -c "$@" & + ("$@") & + child_pid=$! + + sleep $SLEEP_TIME + kill -TERM -$child_pid 2>/dev/null + sleep 5 + kill -KILL -$child_pid 2>/dev/null + echo "$1 was killed due to timeout" +} + depend_kernel() { (( $DEPEND_KERNEL )) || return 0 @@ -357,7 +374,7 @@ depend_kernel() # use the expect script to "make oldconfig" and answer the questions for # new items conservatively. QA will get notified on anything newly added # for them to review and adjust accordingly. - $TOPDIR/build/update_oldconfig + timed_run 300 $TOPDIR/build/update_oldconfig # now notify if resulting .config is different than $CONFIG_FILE local tmpfile=$(mktemp /tmp/XXXXXX) diff -I '^#.*' -u "$CONFIG_FILE" .config >$tmpfile