The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1442

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
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.
From 874abba03d867fa3d43d60fb48a16756fb3879cf Mon Sep 17 00:00:00 2001
From: Matt Keeler <mkee...@users.noreply.github.com>
Date: Wed, 22 Feb 2017 15:57:59 -0500
Subject: [PATCH] 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.
---
 hooks/clonehostname | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hooks/clonehostname b/hooks/clonehostname
index ed2765c..8eec7a6 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
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to