From: Serge Hallyn Date: Tue, 31 Jul 2012 14:01:28 +0000 (+0200) Subject: ubuntu template: handle /etc/resolv.conf being a symlink X-Git-Tag: lxc-0.8.0~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12170cf8e7eeed59cc3b14e9b129dc46257b81de;p=thirdparty%2Flxc.git ubuntu template: handle /etc/resolv.conf being a symlink Signed-off-by: Serge Hallyn Signed-off-by: Daniel Lezcano --- diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index 0061798cd..f3fb8dcc4 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -468,9 +468,13 @@ post_process() chroot $rootfs apt-get install --force-yes -y python-software-properties chroot $rootfs add-apt-repository ppa:ubuntu-virt/ppa fi - cp /etc/resolv.conf "${rootfs}/etc" + cresolvonf="${rootfs}/etc/resolv.conf" + mv $cresolvonf ${cresolvonf}.lxcbak + cat /etc/resolv.conf > ${cresolvonf} chroot $rootfs apt-get update chroot $rootfs apt-get install --force-yes -y lxcguest + rm -f ${cresolvonf} + mv ${cresolvonf}.lxcbak ${cresolvonf} fi # If the container isn't running a native architecture, setup multiarch