From: Lenz Grimmer Date: Fri, 12 Jun 2015 23:08:41 +0000 (+0200) Subject: use `hostname` for DHCP_HOSTNAME in ifcfg-eth0 X-Git-Tag: lxc-2.0.0.beta1~240^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F569%2Fhead;p=thirdparty%2Flxc.git use `hostname` for DHCP_HOSTNAME in ifcfg-eth0 Updated centos/fedora/oracle templates to use `hostname` for DHCP_HOSTNAME in /etc/sysconfig/network/ifcfg-eth0, so the container's host name is propagated to the host's DHCP server (e.g. dnsmasq, which also acts as the DNS server). This resolves lxc/lxd#756 Signed-off-by: Lenz Grimmer --- diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in index 5e1f50be7..946eb5ced 100644 --- a/templates/lxc-centos.in +++ b/templates/lxc-centos.in @@ -253,7 +253,7 @@ HOSTNAME=${UTSNAME} NM_CONTROLLED=no TYPE=Ethernet MTU=${MTU} -DHCP_HOSTNAME=$name +DHCP_HOSTNAME=\`hostname\` EOF # set the hostname diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in index 013546ad9..7faa9398a 100644 --- a/templates/lxc-fedora.in +++ b/templates/lxc-fedora.in @@ -226,6 +226,7 @@ DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes HOSTNAME=${utsname} +DHCP_HOSTNAME=\`hostname\` NM_CONTROLLED=no TYPE=Ethernet MTU=${MTU} diff --git a/templates/lxc-oracle.in b/templates/lxc-oracle.in index 13fad95db..fbd0fd2ea 100644 --- a/templates/lxc-oracle.in +++ b/templates/lxc-oracle.in @@ -336,7 +336,7 @@ DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes HOSTNAME=$name -DHCP_HOSTNAME=$name +DHCP_HOSTNAME=\`hostname\` NM_CONTROLLED=no TYPE=Ethernet EOF