From: Matt Keeler Date: Wed, 22 Feb 2017 20:57:59 +0000 (-0500) Subject: Use LXC_ROOTFS_MOUNT in clonehostname hook X-Git-Tag: lxc-2.1.0~192^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1442%2Fhead;p=thirdparty%2Flxc.git Use LXC_ROOTFS_MOUNT in clonehostname hook Previously this hook did not work when cloning containers using an overlayfs snapshot as the LXC_ROOTFS_PATH didn't point to the actual filesystem that the container would see. LXC_ROOTFS_MOUNT should be used instead and in fact lxc.container.conf man page says that you usually would want to use the _MOUNT variant. Signed-off-by: Matt Keeler --- diff --git a/hooks/clonehostname b/hooks/clonehostname index ed2765c4d..8eec7a665 100755 --- a/hooks/clonehostname +++ b/hooks/clonehostname @@ -19,9 +19,9 @@ # Note that /etc/hostname is updated by lxc itself for file in \ - $LXC_ROOTFS_PATH/etc/sysconfig/network \ - $LXC_ROOTFS_PATH/etc/sysconfig/network-scripts/ifcfg-* \ - $LXC_ROOTFS_PATH/etc/hosts ; + $LXC_ROOTFS_MOUNT/etc/sysconfig/network \ + $LXC_ROOTFS_MOUNT/etc/sysconfig/network-scripts/ifcfg-* \ + $LXC_ROOTFS_MOUNT/etc/hosts ; do if [ -f $file ]; then sed -i "s|$LXC_SRC_NAME|$LXC_NAME|" $file