Raphael Hertzog <[EMAIL PROTECTED]> writes:

> Following my previous bug report I switched my chroot to "plain" type and
> got this:
> [EMAIL PROTECTED]:~$ 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.

Attachment: pgpDBvd5piLxX.pgp
Description: PGP signature

Reply via email to