]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Use LXC_ROOTFS_MOUNT in clonehostname hook 1442/head
authorMatt Keeler <mkeeler@users.noreply.github.com>
Wed, 22 Feb 2017 20:57:59 +0000 (15:57 -0500)
committerMatt Keeler <mjkeeler7@gmail.com>
Thu, 23 Feb 2017 15:13:16 +0000 (10:13 -0500)
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 <mjkeeler7@gmail.com>
hooks/clonehostname

index ed2765c4d68f5ddfca86a4bda33751900f56dfc1..8eec7a6658220a13a22a9bf92d87e0fc93e6f727 100755 (executable)
@@ -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