]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
use `hostname` for DHCP_HOSTNAME in ifcfg-eth0
authorLenz Grimmer <lenz@grimmer.com>
Fri, 12 Jun 2015 23:08:41 +0000 (01:08 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 14 Aug 2015 17:22:03 +0000 (13:22 -0400)
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 <lenz@grimmer.com>
templates/lxc-centos.in
templates/lxc-fedora.in
templates/lxc-oracle.in

index 282e3a593a4687648ebca26108d89a3f475bbb7c..802e95101f4b70d10db19935533b4506bbe7b323 100644 (file)
@@ -247,7 +247,7 @@ HOSTNAME=${UTSNAME}
 NM_CONTROLLED=no
 TYPE=Ethernet
 MTU=${MTU}
-DHCP_HOSTNAME=$name
+DHCP_HOSTNAME=\`hostname\`
 EOF
 
     # set the hostname
index 26fe57fa21cd956049ca672be8f910d6ba204865..68eecdef047eae0ae3d6a27de8dbb3981b1de353 100644 (file)
@@ -220,6 +220,7 @@ DEVICE=eth0
 BOOTPROTO=dhcp
 ONBOOT=yes
 HOSTNAME=${utsname}
+DHCP_HOSTNAME=\`hostname\`
 NM_CONTROLLED=no
 TYPE=Ethernet
 MTU=${MTU}
index 97a3a2a899f61fced2d553175c8e2594c8cd3384..daaa63d31291946db81c3cff06881cb82afa2782 100644 (file)
@@ -290,7 +290,7 @@ DEVICE=eth0
 BOOTPROTO=dhcp
 ONBOOT=yes
 HOSTNAME=$name
-DHCP_HOSTNAME=$name
+DHCP_HOSTNAME=\`hostname\`
 NM_CONTROLLED=no
 TYPE=Ethernet
 EOF