diff options
author | Bryan Drewery <bryan@shatow.net> | 2022-11-10 07:14:35 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2022-11-10 07:18:09 +0300 |
commit | ed634c7f699848818699cacc72ed828fc0d4d2d2 (patch) | |
tree | f4ba5295729c1b6b077a89b33a6d84aa892885b2 | |
parent | 4ce12fb90b4ce55e9fc13ce1f8d057c6f3ee3207 (diff) |
Use setsid(1) for port build phases
Fixes #1008
-rwxr-xr-x | src/share/poudriere/common.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 19ab4e41..13f016d4 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -662,13 +662,13 @@ injail_tty() { if [ -n "${MAX_MEMORY}" ]; then MAX_MEMORY_BYTES="$((MAX_MEMORY * 1024 * 1024 * 1024))" fi - jexec -U ${JUSER:-root} ${name}${JNETNAME:+-${JNETNAME}} \ + ${JEXEC_SETSID-} jexec -U ${JUSER:-root} ${name}${JNETNAME:+-${JNETNAME}} \ ${JEXEC_LIMITS+/usr/bin/limits} \ ${MAX_MEMORY_BYTES:+-v ${MAX_MEMORY_BYTES}} \ ${MAX_FILES:+-n ${MAX_FILES}} \ "$@" else - jexec -U ${JUSER:-root} ${name}${JNETNAME:+-${JNETNAME}} \ + ${JEXEC_SETSID-} jexec -U ${JUSER:-root} ${name}${JNETNAME:+-${JNETNAME}} \ "$@" fi } @@ -4254,6 +4254,7 @@ build_port() { local testfailure=0 local max_execution_time allownetworking local _need_root NEED_ROOT PREFIX MAX_FILES + local JEXEC_SETSID _my_path mnt _log_path log @@ -4313,6 +4314,10 @@ build_port() { fi for phase in ${targets}; do + case "${phase}" in + configure|build|test) JEXEC_SETSID="setsid -w" ;; + *) JEXEC_SETSID= ;; + esac max_execution_time=${MAX_EXECUTION_TIME} phaseenv= JUSER=${jailuser} |