[Buildd-tools-devel] Bug#428808: Bug#428808: schroot: Fails if chroot's /etc/resolv.conf already points to the right resolv.conf

Roger Leigh rleigh at whinlatter.ukfsn.org
Thu Jun 14 21:22:50 UTC 2007


Raphael Hertzog <hertzog at debian.org> writes:

> Following my previous bug report I switched my chroot to "plain" type and
> got this:
> rhertzog at rivendell:~$ schroot -c sarge
> cp: `/etc/resolv.conf' and `/var/lib/schroot/mount/sarge-dc129170-7fe7-44ad-9a5e-a7f4e67a716a/etc/resolv.conf' are the same file
> E: sarge-dc129170-7fe7-44ad-9a5e-a7f4e67a716a: Chroot setup failed: stage=setup-start
>
> This is because I have <chroot>/etc/resolv.conf as a symlink pointing
> to .host/resolv.conf and <chroot>/etc/.host/ is bind mounted to the real /etc/.

That's not recommended, in case anything trashes your host system's
passwd/group/resolv.conf.  We deliberately copy them into the chroot
so that bind-mounted files on the host can't be accidentally damaged
either by the setup scripts or any action taken inside the chroot.

This isn't ideal; I'm willing to look into any suggestions for better
ways of handling these files inside the chroot.  Ideally it should
better cope with different NSS configurations in addition to files,
but we can't be sure the necessary packages are present to cope with
different setups.

> It looks like /etc/schroot/setup.d/20network could be enhanced to check
> for this specific case at least. Or it could simply do nothing if the
> chroot's resolv.conf is a symlink. 

We can certainly stat(1) both and check if the device and inode
numbers are the same.  I'm not so sure about the symlink; I don't know
how the script can be certain of correctly assuming the intent of the
system administrator in this case.


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20070614/a9d814d9/attachment.pgp 


More information about the Buildd-tools-devel mailing list