#1073536 schroot: Fails to start when systemd-resolved is installed (20copyfiles: realpath: .../run/systemd/resolve/stub-resolv.conf: No such file or directory)

Package:
schroot
Source:
schroot
Description:
Execute commands in a chroot environment
Submitter:
Arnaud Rebillout
Date:
2024-06-17 04:27:03 UTC
Severity:
normal
Tags:
#1073536#5
Date:
2024-06-17 02:22:25 UTC
From:
To:
Dear Maintainer,

this was already reported and fixed a while ago, cf.
https://bugs.debian.org/1020277.

I can't say if the bug resurfaced lately, or if it was never really
fixed, as I had a workaround in place. However today I notice the bug is
still here, and easy to reproduce. Here are the steps:

```
cd <somewhere>

## chroot setup

sudo debootstrap sid sid

sudo tee << EOF /etc/schroot/chroot.d/sid-amd64-test.conf
[sid-amd64-test]
description=Debian sid/amd64
type=directory
directory=${PWD}/sid
union-type=overlay
users=${LOGNAME}
root-users=${LOGNAME}
source-users=${LOGNAME}
source-root-users=${LOGNAME}
EOF

ls -l sid/etc/resolv.conf    # is a regular file

## install systemd-resolved in the chroot

schroot -c source:sid-amd64-test -u root -- apt update
schroot -c source:sid-amd64-test -u root -- apt install -y systemd-resolved

ls -l sid/etc/resolv.conf    # is a symlink -> ../run/systemd/resolve/stub-resolv.conf

## the chroot is now broken

$ schroot  -c source:sid-amd64-test -u root -- apt update
E: 20copyfiles: realpath: /run/schroot/mount/sid-amd64-test-[...]/run/systemd/resolve/stub-resolv.conf: No such file or directory
E: 20copyfiles: dirname: missing operand
E: 20copyfiles: Try 'dirname --help' for more information.
E: 20copyfiles: mkdir: missing operand
E: 20copyfiles: Try 'mkdir --help' for more information.
E: sid-amd64-test-[...]: Chroot setup failed: stage=setup-start
```

Best,

Arnaud

#1073536#10
Date:
2024-06-17 04:21:45 UTC
From:
To:
Patch at https://salsa.debian.org/debian/schroot/-/merge_requests/3