Package: schroot
Version: 1.6.13-2
Severity: normal
User: [email protected]
Usertags: origin-kali

Dear Maintainer,

in a chroot I need to install systemd-resolved. systemd-resolved creates
a symlink etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf,
which is a dangling symlink.

Consequently, schroot fails to start the chroot:

  E: 20copyfiles: cp: not writing through dangling symlink 
'<<CHROOT>>/etc/resolv.conf'
  E: <<CHROOT>>: Chroot setup failed: stage=setup-start

To reproduce:

~~~~
# debootstrap sid sid-resolved

# cat << EOF > /etc/schroot/chroot.d/sid-resolved
[sid-resolved]
type=directory
directory=$(pwd)/sid-resolved
profile=default
groups=root,sbuild
root-groups=root,sbuild
EOF

# schroot -c sid-resolved -- sh -c "apt-get update && apt-get install -y 
systemd-resolved"

# schroot -c sid-resolved 
E: 20copyfiles: cp: not writing through dangling symlink 
'/var/run/schroot/mount/sid-resolved-2b844c78-1704-45e6-a260-6e8271ea2f2d/etc/resolv.conf'
E: sid-resolved-2b844c78-1704-45e6-a260-6e8271ea2f2d: Chroot setup failed: 
stage=setup-start

# ls -l sid-resolved/etc/resolv.conf
lrwxrwxrwx 1 root root 39 Sep 19 14:40 sid-resolved/etc/resolv.conf -> 
../run/systemd/resolve/stub-resolv.conf
~~~~

We can force cp to copy the file anyway by using the option
--remove-destination. Cf. merge request at:
https://codeberg.org/shelter/reschroot/pulls/4

Regards,

Arnaud

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

Kernel: Linux 5.19.0-1-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages schroot depends on:
ii  debconf [debconf-2.0]           1.5.79
ii  libboost-filesystem1.74.0       1.74.0-17
ii  libboost-iostreams1.74.0        1.74.0-17
ii  libboost-program-options1.74.0  1.74.0-17
ii  libc6                           2.34-7
ii  libgcc-s1                       12.2.0-2
ii  libpam0g                        1.5.2-2
ii  libstdc++6                      12.2.0-2
ii  libuuid1                        2.38.1-1
ii  schroot-common                  1.6.13-2
ii  sysvinit-utils [lsb-base]       3.05-2

schroot recommends no packages.

Versions of packages schroot suggests:
pn  aufs-tools | unionfs-fuse  <none>
pn  btrfs-progs                <none>
ii  bzip2                      1.0.8-5
ii  debootstrap                1.0.127
ii  lvm2                       2.03.16-1
ii  qemu-user-static           1:7.0+dfsg-7+b1
ii  xz-utils                   5.2.5-2.1
pn  zfsutils-linux             <none>
ii  zstd                       1.5.2+dfsg-1

-- debconf information:
  schroot/bad-names:

Reply via email to