X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=build%2Flmake;h=34b03ebd0fdfdd09fd3b2477b259e6cafc088310;hp=40263ed7fe8be3e6746909365246d0d543babeea;hb=7e6d714c8b58465e8f946c37cc78b06077fee23c;hpb=9a34ef9171c846965685828cb0fe0812b00b1ced 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