diff options
author | Bryan Drewery <bryan@shatow.net> | 2014-04-04 16:17:06 +0400 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2014-04-04 16:17:06 +0400 |
commit | 4cf0fe8ff3a4bb0ba1a754a5d76e6be9cb6fd3e8 (patch) | |
tree | c52fc996d755e889d33b44c3cf66217ca394cb4a /src/share | |
parent | d4a101d2c6cb4252a4ccd230d59f1f17d1bc7886 (diff) |
nohang: Specify pidfile as an argument
Diffstat (limited to 'src/share')
-rwxr-xr-x | src/share/poudriere/common.sh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 70df2883..76d4fcd5 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -1519,10 +1519,11 @@ check_fs_violation() { } nohang() { - [ $# -gt 4 ] || eargs nohang cmd_timeout log_timeout logfile cmd + [ $# -gt 5 ] || eargs nohang cmd_timeout log_timeout logfile pidfile cmd local cmd_timeout local log_timeout local logfile + local pidfile local childpid local now starttime local fifo @@ -1533,7 +1534,8 @@ nohang() { cmd_timeout="$1" log_timeout="$2" logfile="$3" - shift 3 + pidfile="$4" + shift 4 read_timeout=$((log_timeout / 10)) @@ -1553,8 +1555,7 @@ nohang() { exit $ret ) & childpid=$! - echo "$childpid" > \ - ${MASTERMNT}/poudriere/var/run/${MY_JOBID:-00}_nohang.pid + echo "$childpid" > ${pidfile} # Now wait on the cmd with a timeout on the log's mtime while :; do @@ -1592,7 +1593,7 @@ nohang() { exec 7<&- exec 7>&- - rm -f ${MASTERMNT}/poudriere/var/run/${MY_JOBID:-00}_nohang.pid + rm -f ${pidfile} return $ret } @@ -1825,6 +1826,7 @@ Try testport with -n to use PREFIX=LOCALBASE" nohang ${max_execution_time} ${NOHANG_TIME} \ ${log}/logs/${PKGNAME}.log \ + ${MASTERMNT}/poudriere/var/run/${MY_JOBID:-00}_nohang.pid \ injail env ${pkgenv} ${phaseenv} ${PORT_FLAGS} \ make -C ${portdir} ${phase} hangstatus=$? # This is done as it may return 1 or 2 or 3 |