diff options
author | Bryan Drewery <bryan@shatow.net> | 2014-04-24 02:27:28 +0400 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2014-04-24 02:27:28 +0400 |
commit | 60ee8cf0aee346e2ad7ef8a21b195094762ca611 (patch) | |
tree | b6cf84fe05be7f74cd3aef54869555ae20cd9dda /src/share | |
parent | 101ebf389c7eeaf07e11031a6a7069b6a45614ce (diff) |
Exit with status "stopped:LAST STATUS", always giving clear indication it is stopped.
Diffstat (limited to 'src/share')
-rwxr-xr-x | src/share/poudriere/common.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 1e51c408..3edb92ff 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -449,7 +449,8 @@ siginfo_handler() { local format_origin_phase format_phase [ -n "${nbq}" ] || return 0 - [ "${status}" = "index:" -o "${status}" = "crashed:" ] && return 0 + [ "${status}" = "index:" -o "${status#stopped:}" = "crashed:" ] && \ + return 0 if [ ${nbq} -gt 9999 ]; then queue_width=5 @@ -1196,9 +1197,12 @@ setup_makeconf() { jail_stop() { [ $# -ne 0 ] && eargs jail_stop + local last_status - # err() will set status to 'crashed', don't override. - [ -n "${CRASHED}" ] || bset status "stopped:" 2>/dev/null || : + # Don't override if there is a failure to grab the last status. + last_status=$(bget status 2>/dev/null || :) + [ -n "${last_status}" ] && bset status "stopped:${last_status}" \ + 2>/dev/null || : jstop || : # Shutdown all builders @@ -2104,7 +2108,7 @@ calculate_elapsed() { start_end_time=$(stat -f '%B %m' ${log}/.poudriere.status) start_time=${start_end_time% *} case "${status}" in - sigterm:|sigint:|crashed:|stop:|stopped:) + sigterm:|sigint:|crashed:|stop:|stopped:*) end_time=${start_end_time#* } ;; *) end_time=${now} ;; |