From ef0295b560c823c21fccec0731cab2e642ba0409 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 16 Sep 2013 17:53:24 +0000 Subject: [PATCH] Only mount hostname files if config exists Upstream-commit: 5a01f7485c6df95f747e08d2cad3d4c934b811bc Component: engine --- components/engine/lxc_template.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/engine/lxc_template.go b/components/engine/lxc_template.go index 7013581232..b34ff856a2 100644 --- a/components/engine/lxc_template.go +++ b/components/engine/lxc_template.go @@ -30,9 +30,11 @@ lxc.network.ipv4 = {{.NetworkSettings.IPAddress}}/{{.NetworkSettings.IPPrefixLen {{$ROOTFS := .RootfsPath}} lxc.rootfs = {{$ROOTFS}} +{{if and .HostnamePath .HostsPath}} # enable domain name support lxc.mount.entry = {{.HostnamePath}} {{$ROOTFS}}/etc/hostname none bind,ro 0 0 lxc.mount.entry = {{.HostsPath}} {{$ROOTFS}}/etc/hosts none bind,ro 0 0 +{{end}} # use a dedicated pts for the container (and limit the number of pseudo terminal # available)