[Buildd-tools-devel] Bug#519876: Bug#519876: schroot: please define SCHROOT_NAME and SCHROOT_SESSION_NAME env variables

Roger Leigh rleigh at codelibre.net
Sat Mar 21 14:31:09 UTC 2009


On Sun, Mar 15, 2009 at 04:37:20PM -0400, Yaroslav Halchenko wrote:
> 
> I would really love to have those available in the chroot environment so I
> could add them into my PS* to disambiguate either I am in chroot or
> not. So far there are 
> $SCHROOT_COMMAND  $SCHROOT_GROUP    $SCHROOT_USER     
> $SCHROOT_GID      $SCHROOT_UID  
> 
> having 
> 
> SCHROOT_NAME=sid
> SCHROOT_SESSION_NAME=sid-a0067558-c3e8-46d9-95d0-39a92de4863c

Are you aware of the existence of /etc/debian_chroot?  This is
already used by the bash shell for its prompt:

$ schroot -c unstable
I: [sid-amd64-sbuild-c8773e4d-a52b-4378-9975-baaeb3c2bd48 chroot] Running login shell: ‘/bin/sh’
(sid-amd64-sbuild)rleigh at ravenclaw:/tmp$ cat /etc/debian_chroot
sid-amd64-sbuild

(unstable is an alias for the sid-amd64-sbuild chroot).


I can add a SCHROOT_SESSION_ID environment variable very easily.
Adding the original chroot name is somewhat harder (it's replaced
by the session ID, and so is not longer known at the time we set
up the environment).  I would need to store the original chroot
name somewhere for that.



Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.





More information about the Buildd-tools-devel mailing list