[buildd-tools-devel] Bug#633671: Bug#633671: schroot behaves differently depending on cwd

Thibaut VARENE varenet at debian.org
Tue Jul 12 19:50:22 UTC 2011


On Tue, Jul 12, 2011 at 9:33 PM, Roger Leigh <rleigh at codelibre.net> wrote:

> This is known and expected behaviour.  The reason is that when you
> enter the chroot, schroot will change you into the /same directory/
> inside the chroot that you were in on the host system.  When you
> run a login shell, it will try a set of fallback directories; but
> when you run a command it's not possible to do that (see below).
>
> If you're in a location present in both the chroot and on the host,
> e.g. /, /usr, /tmp etc., it will work just fine.  If you don't
> bind mount /home and you're in /home/$user or in /srv/foobar, then
> the same path won't exist in the chroot, and schroot will bail out.

I see.

> The solution is to run schroot with the -d|--directory option to
> explictly specify the path you want inside the chroot.  In this
> case, you can simply use "-d /" to run in the root.

Good point, I've tweaked the script accordingly.

> The reason we don't implement a fallback is because it would make
> the behaviour unpredictable.  The exact logic is as follows:

OK. I'm not entirely sure I see how it would be unpredictable, and
more to the point why dchroot behaves differently from schroot, but
then again, I'm not very familiar with either tool.

The thing is that the error message isn't really explicit, when you're
unaware of this "design choice"... I don't how it could be improved
though.

> Chdir fallback behaviour:
[...]

noted

>  Note that --debug=notice will show the internal fallback list
>  computed for the session.

OK.

You might want to mark this bug as "wontfix", it might serve as some
documentation in websearches ;-)

Thanks
T-Bone

-- 
Thibaut VARENE
http://www.parisc-linux.org/~varenet/





More information about the Buildd-tools-devel mailing list