From aea9747918daa1b597d88b78ff2f47e93c43f6e1 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 26 Apr 2016 22:39:36 +0200 Subject: [PATCH] mount/umounting a chroot should not mess with resolv.conf at all Signed-off-by: Steven Armstrong --- cdist/conf/type/__chroot_mount/gencode-remote | 9 --------- cdist/conf/type/__chroot_umount/gencode-remote | 5 ----- 2 files changed, 14 deletions(-) diff --git a/cdist/conf/type/__chroot_mount/gencode-remote b/cdist/conf/type/__chroot_mount/gencode-remote index 7ec41f28..a3b94b33 100755 --- a/cdist/conf/type/__chroot_mount/gencode-remote +++ b/cdist/conf/type/__chroot_mount/gencode-remote @@ -41,13 +41,4 @@ mountpoint -q "${chroot}/dev/pts" \ [ -d "${chroot}/tmp" ] || mkdir -m 1777 "${chroot}/tmp" mountpoint -q "${chroot}/tmp" \ || mount -t tmpfs -o mode=1777,strictatime,nodev,nosuid tmpfs "${chroot}/tmp" - -if [ -f "${chroot}/etc/resolv.conf" ]; then - # if file exists, bind mount over it - mountpoint -q "${chroot}/etc/resolv.conf" \ - || mount --bind -o ro /etc/resolv.conf "${chroot}/etc/resolv.conf" -else - # otherwise copy - cp /etc/resolv.conf "${chroot}/etc/resolv.conf" -fi DONE diff --git a/cdist/conf/type/__chroot_umount/gencode-remote b/cdist/conf/type/__chroot_umount/gencode-remote index cbcdeff2..bb854efe 100755 --- a/cdist/conf/type/__chroot_umount/gencode-remote +++ b/cdist/conf/type/__chroot_umount/gencode-remote @@ -26,11 +26,6 @@ umount -l "${chroot}/dev/pts" umount -l "${chroot}/dev" umount -l "${chroot}/sys" umount -l "${chroot}/proc" -if mountpoint -q "${chroot}/etc/resolv.conf"; then - umount "${chroot}/etc/resolv.conf" -else - rm -rf "${chroot}/etc/resolv.conf" -fi if [ -d "${chroot}/etc/resolvconf/resolv.conf.d" ]; then # ensure /etc/resolvconf/resolv.conf.d/tail is not linked to \ # e.g. /etc/resolvconf/resolv.conf.d/original