Browse code

Only mount hostname files if config exists

Michael Crosby authored on 2013/09/17 02:53:24
Showing 1 changed files
... ...
@@ -30,9 +30,11 @@ lxc.network.ipv4 = {{.NetworkSettings.IPAddress}}/{{.NetworkSettings.IPPrefixLen
30 30
 {{$ROOTFS := .RootfsPath}}
31 31
 lxc.rootfs = {{$ROOTFS}}
32 32
 
33
+{{if and .HostnamePath .HostsPath}}
33 34
 # enable domain name support
34 35
 lxc.mount.entry = {{.HostnamePath}} {{$ROOTFS}}/etc/hostname none bind,ro 0 0
35 36
 lxc.mount.entry = {{.HostsPath}} {{$ROOTFS}}/etc/hosts none bind,ro 0 0
37
+{{end}}
36 38
 
37 39
 # use a dedicated pts for the container (and limit the number of pseudo terminal
38 40
 # available)