summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-30 22:08:40 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-30 22:08:40 +0000
commitaeffcb7ff1f3450f277bfed4f654dca266927ad9 (patch)
treebe6b56c2520c6f2d14b34fa6c855cf9d085c7c8a /bin/ebuild.sh
parent4c24eec1f0600df3154c8d4fac0334fa73d8a504 (diff)
downloadportage-aeffcb7ff1f3450f277bfed4f654dca266927ad9.tar.gz
portage-aeffcb7ff1f3450f277bfed4f654dca266927ad9.tar.bz2
portage-aeffcb7ff1f3450f277bfed4f654dca266927ad9.zip
Add a python-based setsid script for use with USERLAND=BSD.
svn path=/main/trunk/; revision=13863
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 794738f16..6843331ed 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -26,11 +26,14 @@ PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sb
export PATH
if [[ -z $PORTAGE_SETSID && -n $1 && $1 != depend ]] ; then
+ # If available, use setsid to create a new login session so that we can use
+ # SIGHUP to ensure that no orphaned subprocesses are left running.
if type -P setsid >/dev/null ; then
- # Use setsid to create a new login session so that we can use SIGHUP
- # to ensure that no orphaned subprocesses are left running.
export PORTAGE_SETSID=1
exec setsid "$PORTAGE_BIN_PATH/ebuild.sh" "$@"
+ elif [[ -x $PORTAGE_BIN_PATH/setsid ]] ; then
+ export PORTAGE_SETSID=1
+ exec "$PORTAGE_BIN_PATH/setsid" "$PORTAGE_BIN_PATH/ebuild.sh" "$@"
fi
fi
[[ $PORTAGE_SETSID = 1 ]] && trap 'trap : SIGHUP ; kill -s SIGHUP 0 ;' EXIT