Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13863 - main/trunk/bin
Date: Thu, 30 Jul 2009 22:08:43
Message-Id: E1MWdnl-00048o-2z@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-07-30 22:08:40 +0000 (Thu, 30 Jul 2009)
3 New Revision: 13863
4
5 Added:
6 main/trunk/bin/setsid
7 Modified:
8 main/trunk/bin/ebuild.sh
9 Log:
10 Add a python-based setsid script for use with USERLAND=BSD.
11
12
13 Modified: main/trunk/bin/ebuild.sh
14 ===================================================================
15 --- main/trunk/bin/ebuild.sh 2009-07-30 21:45:00 UTC (rev 13862)
16 +++ main/trunk/bin/ebuild.sh 2009-07-30 22:08:40 UTC (rev 13863)
17 @@ -26,11 +26,14 @@
18 export PATH
19
20 if [[ -z $PORTAGE_SETSID && -n $1 && $1 != depend ]] ; then
21 + # If available, use setsid to create a new login session so that we can use
22 + # SIGHUP to ensure that no orphaned subprocesses are left running.
23 if type -P setsid >/dev/null ; then
24 - # Use setsid to create a new login session so that we can use SIGHUP
25 - # to ensure that no orphaned subprocesses are left running.
26 export PORTAGE_SETSID=1
27 exec setsid "$PORTAGE_BIN_PATH/ebuild.sh" "$@"
28 + elif [[ -x $PORTAGE_BIN_PATH/setsid ]] ; then
29 + export PORTAGE_SETSID=1
30 + exec "$PORTAGE_BIN_PATH/setsid" "$PORTAGE_BIN_PATH/ebuild.sh" "$@"
31 fi
32 fi
33 [[ $PORTAGE_SETSID = 1 ]] && trap 'trap : SIGHUP ; kill -s SIGHUP 0 ;' EXIT
34
35 Added: main/trunk/bin/setsid
36 ===================================================================
37 --- main/trunk/bin/setsid (rev 0)
38 +++ main/trunk/bin/setsid 2009-07-30 22:08:40 UTC (rev 13863)
39 @@ -0,0 +1,10 @@
40 +#!/usr/bin/python -O
41 +# Copyright 2009 Gentoo Foundation
42 +# Distributed under the terms of the GNU General Public License v2
43 +# $Id$
44 +
45 +import os
46 +import sys
47 +
48 +os.setsid()
49 +os.execl(sys.argv[1], *sys.argv[1:])
50
51
52 Property changes on: main/trunk/bin/setsid
53 ___________________________________________________________________
54 Name: svn:executable
55 + *
56 Name: svn:keywords
57 + Id