mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-04-28 20:10:02 +00:00
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 <mjkeeler7@gmail.com>
This commit is contained in:
parent
4fbf4a3172
commit
cd85f31e26
@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
# Note that /etc/hostname is updated by lxc itself
|
# Note that /etc/hostname is updated by lxc itself
|
||||||
for file in \
|
for file in \
|
||||||
$LXC_ROOTFS_PATH/etc/sysconfig/network \
|
$LXC_ROOTFS_MOUNT/etc/sysconfig/network \
|
||||||
$LXC_ROOTFS_PATH/etc/sysconfig/network-scripts/ifcfg-* \
|
$LXC_ROOTFS_MOUNT/etc/sysconfig/network-scripts/ifcfg-* \
|
||||||
$LXC_ROOTFS_PATH/etc/hosts ;
|
$LXC_ROOTFS_MOUNT/etc/hosts ;
|
||||||
do
|
do
|
||||||
if [ -f $file ]; then
|
if [ -f $file ]; then
|
||||||
sed -i "s|$LXC_SRC_NAME|$LXC_NAME|" $file
|
sed -i "s|$LXC_SRC_NAME|$LXC_NAME|" $file
|
||||||
|
Loading…
Reference in New Issue
Block a user