1

In preparation of a chroot I'm doing an mount --bind /etc/resolv.conf ${MOUNTPOINT}/etc/resolv.conf. I need this because the ${MOUNTPOINT} contains a broken etc/resolv.conf.

However, mount is missing the point of the operation. It complains that ${MOUNTPOINT}/etc/resolv.conf "is a symbolic link to nowhere". Yes, I know. That's why I'm doing the rebind in the first place.

[edit] By request, /etc/resolv.conf is a normal file:

-rw-r--r-- 1 root root 42 Feb 6 12:52 /etc/resolv.conf

with normal content

nameserver 192.168.4.1

This should also be used after the chroot, but not by changing the actual ${MOUNTPOINT}/etc/resolv.conf. That should remain as-is:

lrwxrwxrwx 1 root root 27 Jun 14 2017 ${MOUNTPOINT}/etc/resolv.conf -> /run/resolvconf/resolv.conf

(Background: I know about rebinding /run/ in the context of resolv.conf. Doesn't work for me, /etc/resolv.conf is a real file and not a symbolic link. It's only ${MOUNTPOINT}/etc/resolv.conf that's broken, and it's only broken during the chroot so I can't just overwrite it).

terdon
  • 242,166
MSalters
  • 421
  • 5
  • 12

0 Answers0