[buildd-tools-devel] Bug#589917: schroot: TERM environment variable is not preserved

arno renevier arno at renevier.net
Thu Jul 22 08:39:14 UTC 2010


Package: schroot
Version: 1.4.7-1
Severity: normal

Hi,
schroot(1) manual tells:

 default, the environment is not preserved, and the following environment
 variables are defined:  HOME,  LOGNAME,  PATH,  SHELL,    TERM  (preserved
 if  already  defined),  and  USER. 

But TERM variable, even when defined in my host environment is not preserved.
I think it was preserved in previous version, but I don't remember exactly
when.

my config is as follow:

[ia32]
description=Debian testing 32bits
directory=/srv/chroot/ia32
type=directory
users=arno
root-groups=root
root-users=arno                                                                                                            

regards,
arno

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages schroot depends on:
ii  libboost-filesystem1.42.0    1.42.0-3+b1 filesystem operations (portable pa
ii  libboost-program-options1.42 1.42.0-3+b1 program options library for C++
ii  libboost-regex1.42.0         1.42.0-3+b1 regular expression library for C++
ii  libboost-system1.42.0        1.42.0-3+b1 Operating system (e.g. diagnostics
ii  libc6                        2.11.2-2    Embedded GNU C Library: Shared lib
ii  libgcc1                      1:4.4.4-7   GCC support library
ii  liblockdev1                  1.0.3-1.4   Run-time shared library for lockin
ii  libpam0g                     1.1.1-3     Pluggable Authentication Modules l
ii  libstdc++6                   4.4.4-7     The GNU Standard C++ Library v3
ii  libuuid1                     2.17.2-3.1  Universally Unique ID library
ii  schroot-common               1.4.7-1     common files for schroot

schroot recommends no packages.

Versions of packages schroot suggests:
pn  aufs-modules | unionfs-module <none>     (no description available)
pn  btrfs-tools                   <none>     (no description available)
ii  debootstrap                   1.0.23     Bootstrap a basic Debian system
ii  lvm2                          2.02.66-2  The Linux Logical Volume Manager
ii  unzip                         6.0-4      De-archiver for .zip files

-- Configuration Files:
/etc/schroot/default/fstab changed:
proc		/proc		proc	defaults	0	0
/dev            /dev            none    rw,bind         0       0
/dev/pts	/dev/pts	none	rw,bind		0	0
/dev/shm	/dev/shm	none	rw,bind		0	0
/tmp		/tmp		none	rw,bind		0	0

/etc/schroot/schroot.conf changed:
[ia32]
description=Debian testing 32bits
directory=/srv/chroot/ia32
type=directory
users=arno
root-groups=root
root-users=arno

/etc/schroot/setup.d/15killprocs changed:
set -e
. "$SETUP_DATA_DIR/common-data"
. "$SETUP_DATA_DIR/common-functions"
if [ -f "$CHROOT_SCRIPT_CONFIG" ]; then
    . "$CHROOT_SCRIPT_CONFIG"
elif [ "$STATUS" = "ok" ]; then
    fatal "script-config file '$CHROOT_SCRIPT_CONFIG' does not exist"
fi
do_kill_all()
{
    if [ -z "$1" ]; then
	fatal "No path for finding stray processes: not reaping processes in chroot"
    fi
    info "Killing processes run inside $1"
    ls /proc | egrep '^[[:digit:]]+$' |
    while read pid; do
        root=$(readlink /proc/"$pid"/root || true)
        if [ "$root" = "$1" ]; then
            exe=$(readlink /proc/"$pid"/exe || true)
            info "Killing left-over pid $pid (${exe##$1})"
            info "  Sending SIGTERM to pid $pid"
            /bin/kill -TERM "$pid" 2>/dev/null
            count=0
            max=5
            while [ -d /proc/"$pid" ]; do
                count=$(( $count + 1 ))
                info "  Waiting for pid $pid to shut down... ($count/$max)"
                sleep 1
                # Wait for $max seconds for process to die before -9'ing it
                if [ "$count" -eq "$max" ]; then
                    info "  Sending SIGKILL to pid $pid"
                    /bin/kill -KILL "$pid" 2>/dev/null
                    sleep 1
                    break
                fi
            done
        fi
    done
}
if [ $STAGE = "setup-recover" ] || [ $STAGE = "setup-stop" ]; then
    do_kill_all "$CHROOT_MOUNT_LOCATION"
fi


-- no debconf information





More information about the Buildd-tools-devel mailing list